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.

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.

  1. On a terminal, navigate to your CS 340 directory (cs340):

    cd cs340

  2. 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.
  3. Once you have a clone, navigate into your git directory by going into your NetID-named folder:

    cd <NETID>
  4. 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".
  5. 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"