CS 326 Operating Systems

Gitting Started With git

For our assignment submissions, we will leverage git. Git is an excellent version control system that was designed by Linus Torvalds for managing the Linux kernel source tree. More specifically, we’ll be using GitHub, a great web-based UI and hosting platform built around git.

To get started, you’ll need a GitHub account. If you don’t have one, use your USF email address when signing up to make things easier. You will receive an assignment link in class or on Canvas that you’ll accept to create your repository (the place where your code resides), which will include template/starter files.

Desktop App

Installing the GitHub desktop app is a good way to (1) get the required utilities installed on your computer for working with git, (2) managing changes to your repo, and (3) getting ssh keys set up so you don’t need to type a password every time you use git. To download a copy of your code, you’ll clone it to your local machine.

Here’s a link to GitHub Desktop – available for macOS and Windows.

After you have made changes, you will need to push them back to GitHub. After all, we can’t grade what’s stored on your local machine.

Command Line

Most installations of macOS and Linux will have git installed already. You can use the command line utility instead of the desktop app to manage your code:

# Clones the repository to the current directory
git clone https://github.com/username/your-repo

cd ./your-repo
# Here's where the magic happens -- you write/modify some code!
(make some changes to your file(s))

# See what's changed
git status

# Let's check in our change
git add filename

# Let's see what changes are ready to be committed
git status

# Great! Now, let's commit the changes with a nice commit message
git commit -m "Modified function z() to do a, b, c."

# Finally, push the changes back up to GitHub:
git push