Using GitHub

There are many websites offering git repositories, GitHub is one of the most popular ones, especially when it comes to collaborative open source projects. It allows you to have as many public projects as you like. You can also find lots of opportunities to contribute to other projects.

There is a good chance that employers will in fact look at your GitHub page, and where and how you have contributed. Make it look good!

Notes

We will start by creating a GitHub account for you. If you already have an account, then you can skip this step. We start by going to www.github.com.

Pick a username, keep in mind that the rest of the world will know you by that name. Then an email address, and password. Use an email address that you would actually check! Then sign up.

You do not need anything but the free plan, so just keep that one chosen and click on “Finish sign up”.

Great! You should now have received an email asking you to verify your email, go ahead and follow the link there, then click the Confirm button.

You should now be looking at your Settings. You can customize some parts of your account from there. At the very least, go to “Profile” and add your name.

For now you won’t need to do anything else with your account, but we will learn a bit of how GitHub works by looking at the repository hosting the “Node.js” source code.

There should be a search box at the top, use it to search for “node”. The first project you see should be “joyent/node”, follow that link.

At this point you see the main page for a repository. It shows you the most recent commit at the current branch. Take a look at some of the stats for this project, near the top: Over 10k commits, over 100 different branches, over 500 contributors. GitHub makes all that easy.

Right below that you see a colorful bar. Click on it to see language statistics of how much of the project is written in what languages.

If you scroll further down on the page, you will see a README.md, if your project has such a file then it will always show on this main page. It is a good place for information about the project, what it is, how to install it, etc. It uses GitHub flavored Markdown, you will want to start familiarizing yourself with it by following that link. Markdown is used in all discussions and documentation files in GitHub, and in many other places. In fact, this whole website for the class is written in Markdown, and is in fact a GitHub project.

Scroll back at the top and click the “commits” link. This shows you the commit history, and it allows you to go to a particular commit and take a closer look at it. Clicking on the commit title shows you a diff of what changes that commit added to what files. Try one to start getting a feel for it. Once you are OK go back to the commits list, and note the “<>” symbols on the right side of each commit. You can use those links to actually look at what the code looked like at the time of that commit.

A powerful feature of GitHub is the Issues pages, which you can find by following one of the icons on the right side (the one that looks like an exclamation point). This shows you a list of all issues. Issues are questions that someone raises, and they can be assigned labels, a person responsible, they can be commented on, opened, closed etc. They are a great way to track progress in a project. You can also search for specific keywords in an issue.

GitHub also makes it very easy to “fork” a project, so you get a copy of it on your account. Then you can make modifications there, extend it in some ways, then possibly share those changes back with the original project (or not).

We will do this now, to fork the project that I will be using to push the labs out to you. Click the little GitHub icon at the top left, which should take you back out to the main page. Now you can use the search bar, look for “skiadas”. Then in the results, choose “Users”, and follow the link to my account. Then choose “Repositories” from the 3 tabs up top. Find the “WebAppsLabs” repository, and click it. At the top right you will find a “Fork” button, go ahead and click it.

Good! Now you have your own copy of the repository, and it resides in your account. We will use it in the next segment.