1 00:00:08,450 --> 00:00:13,990 In this video, you’ll get an overview of Git and GitHub, which are popular environments 2 00:00:13,990 --> 00:00:20,580 among developers and data scientists for performing version control of source code files and projects 3 00:00:20,580 --> 00:00:24,300 and collaborating with others. 4 00:00:24,300 --> 00:00:29,500 You can’t talk about Git and GitHub without a basic understanding of what version control is. 5 00:00:30,500 --> 00:00:35,960 A version control system allows you to keep track of changes to your documents. 6 00:00:35,960 --> 00:00:40,870 This makes it easy for you to recover older versions of your document if you make a mistake, 7 00:00:40,870 --> 00:00:44,510 and it makes collaboration with others much easier. 8 00:00:44,510 --> 00:00:48,280 Here is an example to illustrate how version control works. 9 00:00:48,280 --> 00:00:53,079 Let’s say you’ve got a shopping list and you want your roommates to confirm the things 10 00:00:53,079 --> 00:00:56,640 you need and add additional items. 11 00:00:56,640 --> 00:01:02,329 Without version control, you’ve got a big mess to clean up before you can go shopping. 12 00:01:02,329 --> 00:01:07,240 With version control, you know EXACTLY what you need after everyone has contributed their ideas. 13 00:01:09,460 --> 00:01:15,539 Git is free and open source software distributed under the GNU General Public License. 14 00:01:15,539 --> 00:01:20,990 Git is a distributed version control system, which means that users anywhere in the world 15 00:01:20,990 --> 00:01:26,220 can have a copy of your project on their own computer; when they’ve made changes, they 16 00:01:26,220 --> 00:01:31,170 can sync their version to a remote server to share it with you. 17 00:01:31,170 --> 00:01:36,030 Git isn’t the only version control system out there, but the distributed aspect is one 18 00:01:36,030 --> 00:01:42,149 of the main reasons it’s become one of the most common version control systems available. 19 00:01:42,149 --> 00:01:47,459 Version control systems are widely used for things involving code, but you can also version 20 00:01:47,459 --> 00:01:53,009 control images, documents, and any number of file types. 21 00:01:53,009 --> 00:01:58,150 You can use Git without a web interface by using your command line interface, but 22 00:01:58,150 --> 00:02:04,069 GitHub is one of the most popular web-hosted services for Git repositories. 23 00:02:04,069 --> 00:02:08,660 Others include GitLab, BitBucket, and Beanstalk. 24 00:02:08,660 --> 00:02:13,700 There are a few basic terms that you will need to know before you can get started. 25 00:02:13,700 --> 00:02:19,989 The SSH protocol is a method for secure remote login from one computer to another. 26 00:02:19,989 --> 00:02:24,959 A repository contains your project folders that are set up for version control. 27 00:02:24,959 --> 00:02:28,049 A fork is a copy of a repository. 28 00:02:28,049 --> 00:02:34,310 A pull request is the way you request that someone reviews and approves your changes 29 00:02:34,310 --> 00:02:36,959 before they become final. 30 00:02:36,959 --> 00:02:42,730 A working directory contains the files and subdirectories on your computer that are associated 31 00:02:42,730 --> 00:02:45,849 with a Git repository. 32 00:02:45,849 --> 00:02:50,040 There are a few basic Git commands that you will always use. 33 00:02:50,040 --> 00:02:55,819 When starting out with a new repository, you only need create it once: either locally, 34 00:02:55,819 --> 00:03:02,400 and then push to GitHub, or by cloning an existing repository by using the command "git init". 35 00:03:03,430 --> 00:03:09,239 "git add" moves changes from the working directory to the staging area. 36 00:03:09,239 --> 00:03:15,180 "git status" allows you to see the state of your working directory and the staged snapshot 37 00:03:15,180 --> 00:03:16,790 of your changes. 38 00:03:16,790 --> 00:03:23,609 "git commit" takes your staged snapshot of changes and commits them to the project. 39 00:03:23,609 --> 00:03:28,970 "git reset" undoes changes that you’ve made to the files in your working directory. 40 00:03:28,970 --> 00:03:34,769 "git log" enables you to browse previous changes to a project. 41 00:03:34,769 --> 00:03:41,150 "git branch" lets you create an isolated environment within your repository to make changes. 42 00:03:41,150 --> 00:03:45,999 "git checkout" lets you see and change existing branches. 43 00:03:45,999 --> 00:03:51,740 "git merge" lets you put everything back together again. 44 00:03:51,740 --> 00:03:56,950 To learn how to use Git effectively and begin collaborating with data scientists around 45 00:03:56,950 --> 00:04:00,840 the world, you will need to learn the essential commands. 46 00:04:00,840 --> 00:04:07,249 Luckily for us, GitHub has amazing resources available to help you get started. 47 00:04:07,249 --> 00:04:14,760 Go to try.github.io to download the cheat sheets and run through the tutorials. 48 00:04:14,760 --> 00:04:19,590 In the following modules, we'll give you a crash course on setting up your local environment 49 00:04:19,590 --> 00:04:21,440 and getting started on a project.