Setting Up git for CS 340
git
is the industry standard for source code repositories and GitHub is the most used implementation of git
. The University of Illinois has an enterprise license to github.com, giving us access to all the fancy features of enterprise GitHub!
Creating a GitHub Account
To log into GitHub, you will use your own personal GitHub account (not your Illinois NetID). You will be privately associating your NetID with your GitHub account to be invited into the @cs340-illinois
course organization.
If you do not have a GitHub account, you need to create a free GitHub account. Most people use their github.com as part of their professional identity, so choosing a professional username is encouraged (ex: wadefagen
is Wade's username, not dy$t0pianUnIc0rN
).
Creating Your Private Course Repository
In CS 340, all of your work will be submitted in your personal, private repository in @cs340-illinois
on GitHub. We have developed a GitHub Repository Creator that will create a private repository for you in @cs340-illinois
and set it up with the permissions so that course staff can also access you work.
- Complete the GitHub Repository Tool all the way until you have a CS 340 repository link: https://edu.cs.illinois.edu/create-gh-repo/sp23_cs340
- You will need to use your repository link in the steps below (highlighted in yellow)
Creating a Local Clone of Your CS 340 Repository
The git
workflow is designed around working on a local clone of your repository that you regularly synchronize with your GitHub repository.
On a terminal, navigate to your CS 340 directory (
cs340
):cd cs340
Clone a local copy of your git repository with the following command (making sure to replace
YOUR-GIT-REPO-URL
with the URL from the "Course Repository Tool" above):git clone <YOUR-GIT-REPO-URL> <NETID> # Ex: git clone https://github.com/cs340-illinois/sp23_cs340_waf waf
- ⚠️ You may get errors running this command and will need to set up your access to your GitHub.
git
error messages are very good! Often the error message will contain a URL where you github provides you the next steps (ex: generating a token, adding OAuth permissions, etc). This command must be successful before you can continue.
Once you have a clone, navigate into your git directory by going into your NetID-named folder:
cd <NETID>
Connect the release repository, which is where initial code will be provided for you as part of CS 340:
git remote add release https://github.com/cs340-illinois/sp23_cs340_.release
- If you get ANY OUTPUT AT ALL, it was NOT successful. (No output means no error! :))
git
error messages are very good! Carefully and completely read the error message to help you out.- If you are not sure, you can run it again and it will say that "the remote already exists".
Finally, let
git
know your student identity (replacing your name and e-mail):git config user.name "Your Name"
git config user.email "netid@illinois.edu"