GitHub is a website where you can store shared repositories of code.

You use it through the web, through the git command from a terminal on turing, or using a GUI client. This page only gives directions for command line use on turing. There are plenty of better resources out there if you want more information.

This class has an "organization" on GitHub: https://github.com/SLU-OS-Fall-2015

Everyone in the class needs an account on github.com. This GitHub account will be your personal account, and will last beyond this class, so feel free to choose any username you like. There is also no need to use your SLU email.

Once you have a GitHub account, I will add you to the class organization. You cannot create your own private repositories, but I will make one for you (or your team) for each assignment.

Setup

To use git on turing, you should configure your ID. Do this with these two commands:
git config --global user.name "Your Full Name Here"
git config --global user.email "your@email.address"

Clone

Each group member should now be able to clone of the repository. From turing, type
git clone https://github.com/SLU-OS-Fall-2015/slush-team-xx.git
where you need to put your team code in place of the xx. git will ask you for your GitHub username and password.

This will create a directory called slush-team-xx with a README file in it, ready for you to work.

Use git

You can now move files into the slush directory and edit them. When you add a file, you need to tell git about it. Once you make a file called slush.c, you would type:
git add slush.c
After you make changes to a file, you need to commit them. An easy way to do this is:
git commit -am "explanation of your changes"
To send your committed changes to GitHub, you type:
git push
and to pull your partner's changes from GitHub, type:
git pull
If you and your partner both change the same file at the same time, git does it's best to merge the files. It is probably best to avoid this situation until you are more comfortable using git.

Take it further

git is very powerful, and these instructions give you no real understanding of how it works.

If you want to learn more, there are plenty of online instructions for using github and git. A good place to start is Pro Git by Scott Chacon.