Working on assignments with GitHub
Big thanks to Ben Wiedermann at HMC for inspiring the following.
Working on assignments with GitHub and Gradescope
In DS002R, we will use GitHub + Gradescope to access and submit assignments. Here is the basic structure of how it will work:
- Get the assignment materials from GitHub.
- Clone the repository to any machine you are using.
- Work on the assignment and push back to GitHub.
- Submit the assignment on Gradescope.
The following diagram lays out the process, and the rest of the document provides a more detailed set of instructions.
Installing R + RStudio + Git
Most importantly, please become familiar with Happy Git and GitHub with R. Happy Git with R is an incredibly user friendly resource which includes help for almost every single thing that might happen when getting started.
The first step is to install R + RStudio + Git on your machine. (If you are planning to use Pomona’s RStudio server, R + RStudio + Git are all three already installed for you.)
Create an account on GitHub (if you already have one, use it!).
Introduce everyone: R + RStudio (should happen automatically); yourself to GitHub (see Happy Git and GitHub with R); RStudio + GitHub (see Happy Git and GitHub with R).
Follow the rest of the steps that Jenny Bryan spells out in Happy Git and GitHub with R. Most likely, you only need to work through step 12. Step 15 is detailed below after you have gotten the assignment from GitHub.
See the fantastic posit::conf talk by Meghan Harris, “Please Let Me Merge Before I Start Crying”: And Other Things I’ve Said at The Git Terminal.
Get the assignment materials from GitHub
Each assignment will be provided within a separate GitHub repository. You will get to the specific repository via the course organization.
The assignment files will be copied as a private repository that you (and your partner(s), if applicable) and the course TAs have access to. Notice that all of the repos are tagged “private.”
We will call this version, that lives on your personal GitHub account, the GitHub fork.
Clone the assignment (or project) repository on to your own computer(s)
Once your repository has been created, you should clone the code to whatever computer you are working on. Just like a Google Doc, you can work on the files from different machines at different times. Unlike a Google Doc, you’ll have to make sure to open the repo (clone
or pull
if you’ve already clone
d) and save the repo (commit
+ push
) more deliberately.
From the course organization, lick on the link for the correct repository.
Click the green
Code
button and copy the URL.
- On the cloning machine (e.g., your own compute or the RStudio server), create a new R project with the URL copied from above. Follow the steps at https://happygitwithr.com/new-github-first.html (section 15.2 New RStudio Project via git clone).
Work on the assignment, push back to GitHub
All of the GitHub interaction will take place through the RStudio IDE. The two important steps for getting the assignment back to GitHub are:
pull
If you are working with a colleague or on different machines it is so incredibly important to get in the habit of immediately clicking on pull
when you start your work. (If you are working alone on a single machine pull
won’t hurt! You’ll just be told that your files are already up to date.)
Render
your work
Don’t forget to put your name on the assignment. Also, make sure that you Render to pdf. Render early and often. The more often you Render, the fewer headaches you will have.
commit
your work
You don’t need to commit every file, but you do need to commit files that are integral to the analysis (always commit .qmd, .pdf, data files, images that created the pdf, etc.).
push
your work to GitHub
It is good practice to use meaningful commit messages to help your future self figure out your past work.
check your work on GitHub
To make sure that the work went through, always check your GitHub repo online to confirm any changes you made.
Submit the assignment on Gradescope
You will submit your assignments via Gradescope on Canvas.
Connecting your GitHub account to Gradescope
The first time you go to submit an assignment on Gradescope, you will be asked to connect to GitHub. Here are the steps to follow to make that connection:
Access Gradescope from Canvas: From Canvas, click on Gradescope in the Course Navigation menu. You will be asked to authorize the Gradescope integration.
Navigate to Gradescope.com: In a new tab (same browser), navigate to https://www.gradescope.com/. Gradescope should recognize your student user account from the Canvas integration.
Go to Gradescope Account Settings: Click on Account (bottom left of the screen) and then Edit Account.
This will take you to your Account Settings in Gradescope. Here, you’ll have the option to verify your Pomona email address and set up a password.
- Link Your GitHub Account to Gradescope: Scroll to the bottom of the page to the Link External Account menu. Click on Link a GitHub account.
You’ll be prompted to authorize GitHub and connect it to Gradescope. In the drop-down menu under Repositories, be sure to select “Public and private” to enable full access.
When prompted, log in to your GitHub account to complete the process (I don’t know if you need your PAT or your “Go(ubs!” password, try both!).
After your accounts have been linked, you’ll see a message that says “Successfully authenticated with GitHub.”
- Return to Canvas & Verify the Connection
Now, you can return to Canvas and navigate back to Gradescope. If you are returning to your previous tab, you may need to refresh the page to make sure your account settings are updated.
Click on your programming assignment in Gradescope. Verify that the GitHub connection is working, and that you can see a list of your GitHub files in the drop-down menu when you are submitting an assignment.
Submitting assignments after having connected to GitHub
To submit your assignment, complete the following steps:
Via Canvas, access the course’s Gradescope site, select the appropriate assignment, and then choose GitHub as the submission method.
Select the appropriate GitHub repository. The branch will always be “main”.
You can submit multiple times before the deadline. Your last submission will determine your grade.
Once assignments are completely graded, you will be able to see your grade and assignment feedback on Gradescope. Grades will also be synced with Canvas.