Course Repo Setup

Course Repository Setup #

Assignments and worksheets for this course are distributed in a central course repository on GitHub. These instructions will get you setup for receiving and submitting assignments in GitHub. These instructions assume you have already followed the computational setup instructions.

Fork #

To start, you need to fork the course repository. This is located at https://github.com/olincollege/softdes-2024-01. You will need to be logged in to GitHub to access this repo. At the top right of the page, you should see a button labeled “Fork.” Click it to fork the repo.

Clone Your Fork #

In your fork (not the main course repo), click the green button that says Code. It will open a drop-down menu; make sure SSH is selected. Copy the url. It should look like git@github.com:myGithubUsername/softdes-2024-01. If the url starts with https://, do not use it; recopy the URL . If you see olincollege instead of your GitHub username, do not use it, that is not your fork but rather the main course repo.

Clone the course repo from GitHub

After you copy this link, open a terminal. In this terminal, run the command git clone FORK-URL, replacing “FORK-URL” with the one you just copied.

Setting Remotes #

You need to configure a few things for your cloned repo. Enter your newly cloned repo by typing cd softdes-2024-01. Back in your web-browser, go back to the main course repo (the one which says olincollege, not your username). Click the green code button, make sure SSH is selected, and copy the URL.

In your terminal run git remote add upstream URL, replacing “URL” with the URL for the main SoftDes course repo (git@github.com:olincollege/softdes-2024-01).

To test that the remote is set correctly, run git remote -v. This should output the following:

origin	git@github.com:myGithubUsername/softdes-2024-01.git (fetch)
origin	git@github.com:myGithubUsername/softdes-2024-01.git (push)
upstream	git@github.com:olincollege/softdes-2024-01.git (fetch)
upstream	git@github.com:olincollege/softdes-2024-01.git (push)

What in the World Did I Just Do? #

You do not need to read this section to go on with your coursework, but you might find yourself asking: “what’s the difference between forking and cloning?”

Forking is creating a personal copy of the main repo on the GitHub servers. Forks are especially useful for collaboration with many users. Each developer can make a fork of the main repo and work on changes separately. These “downstream” changes can then be merged back “upstream” into the main project repo.

Cloning is copying the contents of a repo on a server to your computer. When you make changes to your locally cloned repo, they will not be present on the server until you commit and push your changes. If changes are pushed to the server, they will not be present on your clone until you pull.

When you set the remote in your cloned repo, you are setting an additional source for the project. You set an upstream in the clone of your fork so you can pull changes that are made to the main course repo. For example, a new assignment might get pushed to the main course repo. You can then pull changes from upstream to your version of the repo.