Преподаватели

Jeff Leek, PhD

Associate Professor, Biostatistics

Roger D. Peng, PhD

Associate Professor, Biostatistics

Brian Caffo, PhD

Professor, Biostatistics

Текст видео

This is a very brief introduction to the Git Version Control System. So Version Control is a system that records all the changes that you've made to a file or a set o files over time so that you can, recall specific versions later. It's one of the most commonly used tools for data scientists because, often you'll be working on a set of scripts or a set of programs, and you'll make changes to them and over time, some of those changes will be good, and some of those changes will be bad. And maybe other people will be working at the same time on a similar set of functions that you want to be able to keep track of everything that's being done to those files. So, many of the ways, the way that many of us work with files, whether we create something, we save it, we change it and we save it again, and then when you, what happens is you'll lose those intermediate files, the files that you saved in between the final version and the first version. And so, Version Control means we're just going to try and save or manage all of those intermediate files. And it's really important when you're sort of collaborating with others because, they might be using as, a different intermediate file and you might want to know how to coordinate what happened when you get to the final version. So Git is a free and open source version of of a version control system. It's distributed so it can handle everything from small to very large projects with speed and efficiency. It's one of the most commonly used sort of version control systems right now. It's created by the same people who developed Linux. It's definitely the most popular version control today compared to all the other version control systems like SVN. Everything is stored in local repositories, or on your computer, and they're called repos and then you do most of the operations from the command line. And so this is the link I've given you here is a, sort of a short history of how Git was developed, and how to get started. So, the first thing that you need to do is go and get, download Git. So I've given you the website that you can see right here. So, if you go to that website and download the appropriate version of the software for your operating system, that would be the right place to start. The next thing that you do is, once it's done downloading, you open it up and you begin the installation process, so there'll be an install wizard that will take you through the steps of installing Git. Unless you really know what you're doing, you should probably just go with all the default options at each step of the installation process. Once the installation is finished, you might want to hit the Finish button, although you may want to check uncheck the box next to review the release notes because you probably won't be interested in that at this point. So the first thing that you want to do is open up a program called Git Bash which is the command line enr, environment for interacting with Git. This is particularly true if you're on Windows users. It should be loca, located in to the directory in which Git was installed or for Windows users, it will be in the Start menu now. [BLANK_AUDIO] So, once you have Git Bash open you'll see a short welcome message followed by the name of your computer and a dollar sign on the next line. And so the dollar sign means that it's again, the prompt like you've seen in the sort of command line interface lecture and so, it's your turn to type a command. And so, each commit to a Git repository will be tagged with the username of the person the commit. So what you need to do to sort of get things set up is, you need to enter your username and your e-mail. So you type these commands where you type Git config dash global username. And here you want to type in your username that you're going to be using. And then, you do the same thing only user dot email. And here, you're going to type in the email that you're going to be using with GitHub. You only have to do this once when the system opens up, but you can always change it down the road if you want to use the same commands, if you want to change say your user name or the email that's associated with the Git account. Now type the following to confirm your changes. So, what you do is you just type git config dot dash dash list, like I see, like you see here. And, so, you should be able to see your username and your email and all of that. [BLANK_AUDIO] So right now we're actually going to actually just exit Git Bash. And so so you can do that with this command, just type exit and hit return. So now that Git is setup on your computer ,we're going to do, do some lectures on how do you use GitHub, which is a web development tool for dealing with GitHub. It's dealing with Git, it's widely, widely used among scientists and does lots of neat stuff. And so, once that's up and running we'll show you how to do some of the most important things that you need to do with the Version Control System.