STAT 107 GitHub Setup


Once you have all the tools to do Data Science on your own computer, the last part of setup is to create a git repository where your code will be synchronized online.

Step 1: Install git On Your Computer

First, follow our guide to ensure you have git installed on your computer:

Step 2: Create a stat107 Directory on Your Desktop

All of your Python notebooks for Data Science Discovery (STAT / CS / IS 107) will be synchronized via git to your computer and to GitHub. To store the local copy of your work, we highly recommend creating a folder on your desktop called stat107 (all lower case, no spaces).

  • Create a new, empty folder called stat107 (all lower case, no spaces) on your desktop.

Step 3: Create a Free GitHub Account

To log into GitHub, you will use a GitHub account. After you log in, you will be privately associating your NetID with your GitHub account to be invited into the @stat107-illinois course organization.

  • If you ALREADY have a GitHub account, you should use that account (GitHub does not easily let you switch between two accounts on a single device). Your account does NOT need use your Illinois address (you'll associate your NetID with your specific @stat107-illinois repository in the steps below).

  • If you do NOT yet have a GitHub account, you will need a free account:

    • Most people use their GitHub account as part of their professional identity, so choosing a professional username is encouraged (ex: wadefagen is Wade's username, karleflanagan is Karle's, not something like dy$t0pianUnIc0rN).

    • You only need and will only use features of a free account. (We won't use any of the premium features.) You can use whatever e-mail address you prefer here (it does not need to be your @illinois.edu address).

    • If you do not yet have an account, create a free GitHub account on github.com.

Step 4: Creating Your Private STAT 107 Course Repository

In STAT/CS/IS 107, all Python notebooks you do on your own computer will be submitted in your personal, private repository in @stat107-illinois on GitHub. We have a GitHub Repository Creator that will create a private repository for you in @stat107-illinois and set it up with the permissions so that course staff can also access your work.

  • Make sure to complete ALL STEPS of this repo creator, until it gives your GitHub repo link for STAT 107. You will use the link given to you on the last page in the next step of this guide.
  • Important (!!): Some steps can take up to a full minute to complete – be patient to avoid getting rate limited.
  • Create your @stat107-illinois private repository URL here: https://edu.cs.illinois.edu/create-gh-repo/sp26_stat107
    • You will not need to visit the link it gives you. You will need to use it in the next part instead. :)

In the next section, you will use this URL as your YOUR-GIT-REPO-URL.

Step 5: Creating a Local Clone of Your STAT 107 Repository

The git workflow is designed around working on a local clone of your repository that you regularly synchronize with your GitHub repository.

  1. Follow the complete guide on using the terminal to navigate into your stat107 folder you created on your desktop.

  2. Make absolutely sure your path ends in with stat107 so you're running these commands in the correct location. This will save you a lot of headache later.

    • Your prompt MUST end with either [...]stat107>, [...]stat107 [name]% or [...]stat107 [name]$.
    • If you do not see stat107 in your prompt, DO NOT CONTINUE. Running commands in the wrong location may synchronize all of your computer files online (we don't want that).
  3. Run the command to 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" that you copied above). Additionally, replace NETID with whatever your NetID (the first part of your Illinois e-mail; kflan is Karle's NetID, waf is Wade's NetID):

    git clone YOUR-GIT-REPO-URL NETID
    # Ex: git clone https://github.com/stat107-illinois/sp26_stat107_waf waf
  4. When you run the git clone ... command in the previous step, you may be prompted to log into GitHub:

    • If you see a popup to log into GitHub, log in using your GitHub username/password. (This is different than your @illinois.edu username/password).

    • If you see a terminal-based login, you will use a Personal Access Token instead of your GitHub password. If you do not have a personal access token to GitHub:

      • Create a new token at https://github.com/settings/tokens.
      • Click "Generate New Token" (top-right) and select "Generate new token (classic)".
      • We recommend the note be "STAT 107 login" (or similar).
      • We recommend you set "Expiration" to "No Expiration" (or sometime past the end of the semester).
      • You must have at least repo and workflow permissions. (We won't use any of the others.)
      • Then click "Generate Token". You will use this token as your login instead of your password (paste it from your clipboard when it asks you for your password).
      • (This YouTube video starting at 9:03 does a great job going through these same steps of creating a GitHub token for login if you'd like to see a video of it, with the only difference is that you also need the workflow scope in addition to the repo scope.)

    • git error messages are very good! Often the error message will contain a URL where GitHub provides you the next steps (ex: generating a token, adding OAuth permissions, etc). This command must be successful with no errors before you can continue.

  5. Once you have a clone, navigate into your git directory by going into your NetID-named folder:

    cd NETID
  1. Finally, let git know your student identity (replacing your name with your first and last name and your email with your illinois email address). Make sure to include the quotes around your name and email:

    git config user.name "YOUR NAME INSIDE OF QUOTES"
    git config user.email "NETID@illinois.edu"