Not logged in. Login

Working with Git and GitHub

SFU's GitHub instance will be used for the group work in this course. There are two pieces of technology in play here: GitHub with manages the repositories and permissions, and Git itself as a version control system.

GitHub Setup

Logging In to GitHub

Sign in to the SFU GitHub server with your usual SFU username and password.

Set up an SSH key

You'll probably want to access the repository by SSH. If you don't already have an SSH key, you need to generate one.

Once you have an SSH key, add the key in GitHub.

Create a Project

One group member should create a project with visibility level “Private”.

You'll only be able to search for your group members after they have logged into the system at least once. (The system doesn't have a list of SFU users, so until someone logs in, it has no idea they exist.) So each group member will at least have to visit the site and log in first.

You can then add the other members of the group to the project: in the project, select “Settings” and “Collaborators”. You can search by username and add them as collaborators.

Make sure you add the instructor and TA (ggbaker, taa62, ama240, sma318) to the project as well.

Git Setup

There are a couple of commands you need to run to tell Git who you are, before starting work. Please use your SFU email address:

git config --global user.name "**Your Name**"
git config --global user.email "**userid**@sfu.ca"

Moving to SFU's Github

If you have started the project with a repository elsewhere, it's very quick to migrate to another remote (as long as all group members know the move is happening, of course). Basically, create the project, add it as a new "remote" and merge then push across.

Working on the Project

On the GitHub main project page, you will find the URL where you can clone the Git repository onto your computer. The command will be something like this:

git clone git@github.sfu.ca:ggbaker/your-project.git

The project page itself gives more complete instructions for the first interactions with the repository: you get a very empty repository that requires some bootstrapping.

Working with Git

A Git manual is beyond the scope of this page, but here are the bare basics:

git pull                     # get changes from your group members
text_editor some/file.txt    # do some work
git add some/file.txt        # stage those changes for commit
text_editor other/file.txt   # do some more work
git add other/file.txt       # stage more changes for commit
git commit                   # commit the changes
git push                     # push to the remote server so others can see changes

Here are some Git tutorials for more information:

See Also

Updated Tue Oct. 01 2024, 11:30 by ggbaker.