Bummer! This is just a preview. You need to be signed in with a Basic account to view the entire video.
Exploring the Repo on GitHub3:34 with Jay McGavren
Our repo is on GitHub! Let's look at some of the cool features that visitors to the repo can use.
- You can think of the GitHub UI as a Web version of the Git command line interface. There are ways to get all the same information that you would from the
git logcommand, the
git diffcommand, and more.
- We can click on any file name to look at the source code that file contains.
- On each page, the repository name,
medals, is a link that will take us back to the main repository page.
- The main repository page has a link to the commit history, which was pushed up from your Git repo.
- All the commits you've made will be shown here, along with their commit messages.
- You can click on the partial SHA checksum shown next to each commit. That will take you to a page showing the changes made in that commit.
- This is a public repository, so anyone who has the link can see this page. When someone clicks that link, they'll be able to visit this page and view everything you see here. The only thing they won't be able to do is make changes via their browser.
- They can, however, use Git to clone their own copy of your code on their computers, which they can then make changes to.
- Because this is set up as a public repository, anyone with the URL can clone it, even if they don't have a GitHub account.
- On your repo's main page, there should be a "Clone or Download" button.
- That will reveal the Git URL for the repo.
- Anyone can copy this URL and use it to clone the repo.
- From a terminal, type
git clone, followed by a space, and paste the Git URL that you copied from GitHub.
- From a terminal, type
git clone https://github.com/example/medals.git
Other people won't be able to push commits directly to your GitHub repo. But they can make a "fork" of the repo and push to that. For more info, see: Fork A Repo - User Documentation
GitHub has surged in popularity since its creation because it's one of the best ways 0:00 to share code. 0:05 Like Git, it doesn't have the most user friendly interface out there. 0:05 But once you know what you're doing, there are powerful features available to you, or 0:09 anyone you share your project with. 0:14 In the previous video, we pushed our code from our local repo up to our GitHub repo. 0:16 Let's take a look at our project in a new way, through the GitHub user interface. 0:21 You can think of this as a web version of the Git command line interface. 0:25 There are ways to get all the same information that you would from the git 0:29 log command, the git diff command and more. 0:33 All our files are listed on this page, bronze.html, gold.html, and so on. 0:35 We can click on any of those files to view the source code they contain. 0:41 On each page the repository name, medals, 0:45 is a link that will take us back to the main repository page. 0:48 The main page has a link to the commit history which was pushed up from your 0:53 git repo. 0:58 All the commits you made will be shown here along with their commit messages. 0:58 You can click on the partial shaw checksum shown next to each commit. 1:03 That will take you to a page showing the changes made in that commit. 1:06 Again we can go back to the main repository page by clicking the link with 1:10 the repo name. 1:15 This is a public repository so anyone who has the link can see this page. 1:16 If we go to the browser's address bar and copy the URL of this page, 1:21 then we can share it through Twitter or email or any other channel. 1:25 When someone clicks that link, they'll be able to visit this page and 1:29 view everything you see here. 1:32 The only thing they won't be able to do is make changes via their browser. 1:34 They can however use git to clone their own copy of your code 1:38 onto their own computers and they can then make changes to that copy. 1:41 Because this is set up as a public repository, 1:45 anyone with the URL can clone it, even if they don't have a GitHub account. 1:48 On your repo's main page there should be a Clone or download button. 1:52 It might not look exactly like this, but 1:57 it should be available somewhere on the page. 1:59 That will reveal the git URL for the repo. 2:01 The URL should start with https. 2:04 If that's the case, the link in the upper right of the window will say use https. 2:07 Click that to change the URL back to an https URL. 2:12 Anyone can copy this URL and use it to clone the repo. 2:16 Let's click this button to copy it now. 2:20 I've set up a new, empty workspace with no repos in it so 2:23 we can try cloning from the GitHub repo. 2:26 All I have to do is activate the console and type git clone followed by a space, 2:29 and then paste the Git URL that we copied from GitHub. 2:35 If I run the command, 2:39 it will clone the GitHub repo into a new local repo named medals. 2:41 I can change into the new medals directory, cd medals. 2:46 If I run ls, we'll see all of our files. 2:51 And if I run git status that will show our working director is clean and 2:55 ready to accept new commits. 3:00 And if we run git remote, we'll see a repo named origin, 3:02 which is the Git Hub repo we cloned from. 3:07 Note that others will not be able to push directly to your Git Hub repo, 3:10 you can allow that if you want though. 3:13 See the teacher's notes for more info. 3:15 GitHub is the world's most popular way to share code with others. 3:18 And now, you can push your code there. 3:22 Before we wrap up this course in the next video, you should take a few minutes to go 3:25 through your existing projects and see if there are any you want to share on GitHub 3:29
You need to sign up for Treehouse in order to download course files.Sign up