1 00:00:00,340 --> 00:00:05,003 GitHub has surged in popularity since its creation because it's one of the best ways 2 00:00:05,003 --> 00:00:05,867 to share code. 3 00:00:05,867 --> 00:00:09,968 Like Git, it doesn't have the most user friendly interface out there. 4 00:00:09,968 --> 00:00:14,527 But once you know what you're doing, there are powerful features available to you, or 5 00:00:14,527 --> 00:00:16,451 anyone you share your project with. 6 00:00:16,451 --> 00:00:21,743 In the previous video, we pushed our code from our local repo up to our GitHub repo. 7 00:00:21,743 --> 00:00:25,945 Let's take a look at our project in a new way, through the GitHub user interface. 8 00:00:25,945 --> 00:00:29,865 You can think of this as a web version of the Git command line interface. 9 00:00:29,865 --> 00:00:33,602 There are ways to get all the same information that you would from the git 10 00:00:33,602 --> 00:00:35,978 log command, the git diff command and more. 11 00:00:35,978 --> 00:00:41,932 All our files are listed on this page, bronze.html, gold.html, and so on. 12 00:00:41,932 --> 00:00:45,911 We can click on any of those files to view the source code they contain. 13 00:00:45,911 --> 00:00:48,933 On each page the repository name, medals, 14 00:00:48,933 --> 00:00:53,024 is a link that will take us back to the main repository page. 15 00:00:53,024 --> 00:00:58,006 The main page has a link to the commit history which was pushed up from your 16 00:00:58,006 --> 00:00:58,748 git repo. 17 00:00:58,748 --> 00:01:03,017 All the commits you made will be shown here along with their commit messages. 18 00:01:03,017 --> 00:01:06,868 You can click on the partial SHA checksum shown next to each commit. 19 00:01:06,868 --> 00:01:10,868 That will take you to a page showing the changes made in that commit. 20 00:01:10,868 --> 00:01:15,763 Again we can go back to the main repository page by clicking the link with 21 00:01:15,763 --> 00:01:16,834 the repo name. 22 00:01:16,834 --> 00:01:21,548 This is a public repository so anyone who has the link can see this page. 23 00:01:21,548 --> 00:01:25,449 If we go to the browser's address bar and copy the URL of this page, 24 00:01:25,449 --> 00:01:29,360 then we can share it through Twitter or email or any other channel. 25 00:01:29,360 --> 00:01:32,646 When someone clicks that link, they'll be able to visit this page and 26 00:01:32,646 --> 00:01:34,530 view everything you see here. 27 00:01:34,530 --> 00:01:38,381 The only thing they won't be able to do is make changes via their browser. 28 00:01:38,381 --> 00:01:41,826 They can however use git to clone their own copy of your code 29 00:01:41,826 --> 00:01:45,922 onto their own computers and they can then make changes to that copy. 30 00:01:45,922 --> 00:01:48,538 Because this is set up as a public repository, 31 00:01:48,538 --> 00:01:52,841 anyone with the URL can clone it, even if they don't have a GitHub account. 32 00:01:52,841 --> 00:01:57,298 On your repo's main page there should be a Clone or download button. 33 00:01:57,298 --> 00:01:59,295 It might not look exactly like this, but 34 00:01:59,295 --> 00:02:01,598 it should be available somewhere on the page. 35 00:02:01,598 --> 00:02:04,606 That will reveal the git URL for the repo. 36 00:02:04,606 --> 00:02:07,632 The URL should start with https. 37 00:02:07,632 --> 00:02:12,524 If that's the case, the link in the upper right of the window will say use https. 38 00:02:12,524 --> 00:02:16,956 Click that to change the URL back to an https URL. 39 00:02:16,956 --> 00:02:20,520 Anyone can copy this URL and use it to clone the repo. 40 00:02:20,520 --> 00:02:23,424 Let's click this button to copy it now. 41 00:02:23,424 --> 00:02:26,931 I've set up a new, empty workspace with no repos in it so 42 00:02:26,931 --> 00:02:29,482 we can try cloning from the GitHub repo. 43 00:02:29,482 --> 00:02:35,574 All I have to do is activate the console and type git clone followed by a space, 44 00:02:35,574 --> 00:02:39,809 and then paste the Git URL that we copied from GitHub. 45 00:02:39,809 --> 00:02:41,220 If I run the command, 46 00:02:41,220 --> 00:02:45,464 it will clone the GitHub repo into a new local repo named medals. 47 00:02:46,844 --> 00:02:51,481 I can change into the new medals directory, cd medals. 48 00:02:51,481 --> 00:02:55,233 If I run ls, we'll see all of our files. 49 00:02:55,233 --> 00:03:00,550 And if I run git status that will show our working directory is clean and 50 00:03:00,550 --> 00:03:02,852 ready to accept new commits. 51 00:03:02,852 --> 00:03:07,220 And if we run git remote, we'll see a repo named origin, 52 00:03:07,220 --> 00:03:10,326 which is the Git Hub repo we cloned from. 53 00:03:10,326 --> 00:03:13,985 Note that others will not be able to push directly to your Git Hub repo, 54 00:03:13,985 --> 00:03:15,980 you can allow that if you want though. 55 00:03:15,980 --> 00:03:18,986 See the teacher's notes for more info. 56 00:03:18,986 --> 00:03:22,759 GitHub is the world's most popular way to share code with others. 57 00:03:22,759 --> 00:03:25,751 And now, you can push your code there. 58 00:03:25,751 --> 00:03:29,763 Before we wrap up this course in the next video, you should take a few minutes to go 59 00:03:29,763 --> 00:03:33,790 through your existing projects and see if there are any you want to share on GitHub