Initial Setup
We will be using Github Classroom for this course. Please follow these instructions to set up Git and Github Classroom
- Run through first-time setup to set up Git on the Linux machines.
- Make a Github account with your Trinity email address.
- I suggest your account name should be your Trinity ID (i.e. sfogarty).
- It is highly recommended you set up a Github SSH key. There are tutorials for each step:
- Check if you have an SSH key on the Linux machines.
- If you don't have a key, generate one.
- Github suggests using a passphrase and ssh-agent. I simply left the passphrase bank.
- Adding the key to Github.
- The Linux machines do not have clip.
- You will need to use cat ~/.ssh/id_rsa.pub instead, and copy the output the old-fashioned way: selecting it.
- While logged in to that account, click on any project link to create your own repository with initial code.
- I recommend the Git SCM tutorial, found at http://git-scm.com/book
- On the github page for the repository, click on the green Clone or download button.
- I recommend using "Clone with SSH."
- If the box reads "Clone with HTTPS", click "Use SSH."
- If that is not available, set up your SSH key.
- Click the copy button next to the link.
- To clone your repository into the directory, use
git clone <link>
- To update the repository with any chances made, for instance by staff or other members of a group project, use
git pull
- It is a good idea to use git pull every time you start working, just in case.
- To add a file, or to stage a file you have changed, use:
git add <filename>
- You should never add generated files, such as executable or object files, to your repository.
- You can commit changes to your local repository without pushing them to the repository server. Commit staged files with
git commit
- Alternately, you can commit all changed files with
git commit -a
- When the coded is in a good state, such that it compiles, it's a good idea to push your changes back to Github. Use:
git push
- This uploads all changes so course staff can see them.