In this chapter, we will explore a popular web application, GitHub, and create your first code repository!
Get familiar with GitHub’s interface
First go to the the GitHub website.
It should look like this:
Already, there are a lot of links that will give you a bigger picture of all the tools GitHub has to offer! On the right side, you will see a sign-up form. We'll go through that in a bit, as well as some of the tools; first, let’s take a look at how the repositories look!
If you click in the Search GitHub text box next to Sign in, you can find a specific project by name:
Let's look at Kubernetes. Type it in that box and hit enter. Kubernetes is a great example because it is an active project with thousands of repositories, contributors, and languages!
You can click in any of those repositories and see the source code! Let's take a look at openshift/origin.
I know it looks like a lot of new information! We'll go in to the nuts and bolts later, but for now, let's take a look at what all this means:
In the upper-left corner, you will have the name of the repository. Here, it's openshift/origin. Underneath that, you will see these key tabs:
Code - your source code.
Issues - issues for the community to solve.
Pull requests - suggestions from contributors.
Now when you get to the middle line, you can see how active the project is! The number of commits is the number of new versions that have been saved. The branches are where some alternate versions are archived. In the screenshot above, you will see 338 contributors are an active part of the development!
The green button that says Clone or download is the main link for the Git repository ready to download! Here, any repository can be cloned (copied) or linked!
What if I don't know what repository to look up?
Let’s say you want to look at a project written in another coding language, like Python. At the top banner, go to the drop-down under Explore, and click Explore GitHub.
You can look in Topics for a language or platform that interests you. Choose one, and you will see what that repository looks like on GitHub! See if you'd like to contribute your own issue fixes and features to that repository and become a part of the open source community!
Setting up an account
Let's go back to the main page.
Go ahead and sign up for a GitHub account.
Once you fill out the form, you can choose a subscription. For the purposes of this class, the free account will suffice. It will allow you to have public and private repositories on GitHub so you won’t miss out on anything!
Plus, it's all you need to contribute to open source projects and create your own!
Once that is complete, verify your email, and your account should be all set!
Create your first repository
Now let’s create your first repository!
Click on the Create new repository or the Start a project button. Now you will see a form to name your repository:
To get started, all you have to do is:
Name your repository.
Choose whether you'd want it public or private. A public repository is open for anyone to see and contribute to.
Start with a README file for your project description.
That's it! Now, just click the Create repository button on the bottom. Congrats! You’ve created your first repository! 💫 If you click on the README.md file, you will see that it contains the title you gave your repo (I called mine "hello").
Edit your repository
Click on the Edit button on the right side of the document.
Now add a description of your first repo. Once you're done, you'll see a little box at the bottom of the page called Commit changes. This is where you log and describe what changes you've made to your repository. You can title it something like: wrote description. Just type it in and click the Commit changes button on the button.
You’ve just made your first change on your repository using Git’s version control system! When you clicked the Commit changes button, you created a new version! If you want to go back to the one before you made that change to the README.md, click on the History button on the right corner.
Now let's look at the two commits in history. The first one is when you created the repository and the second one is the commit you just made. Notice the message with the second commit, wrote description. This helps you identify your latest commit!
In the next chapter, you'll set up Git and learn how to contribute to your first open source repository!
To create a free account on GitHub, just follow the instructions on the page.
GitHub’s repositories each list their name, main files, and folders as well as the clone URL. They also have tabs for code, issues, and pull requests.
README files describe code projects and significant changes.
You can edit your repository, commit changes, and then track those changes within the history tab!