GitHub uses the git version control system. Roughly speaking, git is the system that takes care of different versions of your files and merging together changes from different collaborators (and much more!). git is free software.
GitHub is a corporation and the name of the corporation's product. Their site github.com provides servers that host git repositories. This serves as a central place that different collaborators all sync up with.
GitHub Enterprise is a product that allows the GitHub software to be installed on the customer's own servers. UBC has done this so that all the data remains in Canada. Hence https://github.students.cs.ubc.ca/.
The instructions below pertain to using git from the command line. For those who are less comfortable with this sort of thing, I was told that GitHub Desktop makes things a lot easier. So, feel free to try this route instead of the instructions below.
GitHub is a web-based application and does not require set-up. However, you will be working on your homework locally and therefore need git installed locally.
Open Terminal (Applications –> Utilities folder or search with Spotlight). From the terminal, run the command:
xcode-select --install
This will install git and many other very useful applications as well (including Make).
Open the terminal and install git using your system package manager. For example
sudo apt-get install git
should do the trick on Ubuntu.
Go to http://git-scm.com. Click on the download link, and accept all defaults in the installation process. Installing git will also install for you a minimal UNIX environment with a bash shell and terminal window.
Open your Terminal (or Git for Windows) and run git --version
.
If you are returned the version of git, it means your install was successful!
There are many free online resources for learning git. One possibility is the Software Carpentry git tutorial.
For viewing GitHub content in your web browser, you login with your CWL credentials through the browser. However, you need to authenticate separately to interact with GitHub through command-line git. There are two ways to authenticate, described below.
To use a personal access token, go here. Click "Generate new token", check the "repo" box, and then press the green "Generate token" button. You'll be given a new token. Save that and treat it securely (as you would a password).
If you take this approach, then when cloning your repository, make sure you get the clone url that starts with https://github.students.cs.ubc.ca
not the one that starts with [email protected]
. When you try to clone, you will be prompted for a username and password. Enter your CWL username as the username and your token as the password.
Instructions for setting up SSH keys with GitHub can be found here. Please keep in mind that you'll need to add your keys to github.students.cs.ubc.ca - specifically, here - rather than to github.com.
If you take this approach, then when cloning your repository, make sure you get the clone url that starts with [email protected]
, not the one that starts with https://github.students.cs.ubc.ca
.
Your homework repo is only visible to you and the course staff, plus your partner if you are working with one.
Your grades repo will be visible only to yourself and the course staff.
Although only the final version will be graded, all of your commits will be viewable, so don't commit something private (like your email password) to your homework repo. Committing something and then removing it with another commit doesn't remove it from the git history! It is theoretically possible to pull all traces of something out of the git history, but it's not fun and uses more advanced git features.
Probably the easiest way to find a repository is to use the search tool from the cpsc330-2020w-t1 Organization homepage.
We anticipate that you will clone your assignment repo and do your work from within there. When you push something back to github.students.cs.ubc.ca then you have submitted the assignment. You can push changes as many times as you want before the deadline; only the final version will be graded (but see below on past commits).
In addition to the lab-specific repos, you will each have a private repository that will serve as
an inbox for all your grade-related discussions. This repository will be named goatcabin_grades
if your username is goatcabin
. There will be an announcement when grades are released.