Say you’ve got an invitation to one of our GitHub Classroom homework assignments: After accepting the assignment, you’ll have access to a private repository for this specific assignment within your GitHub account. Submitting an assignment will generally follow these steps: copy the assingment from the GitHub repository, edit files, and push the files back up to the assignment’s repository. I will then grade your assignment from your repository.

With a working installation of git on your machine (see, you will generally follow these steps from within a terminal where

$ which git

successfully returns a path and you are in a reasonable directory structure for your homework assignments, eg

$ cd ~/...wherever.../math314/homework/
$ git clone
# this is my repository for HWTODO, you need to find your own for each assignment

Be sure you know what files to submit for each homework assignment. Sometimes you’ll submit a Python scipt, .py. Sometimes homework assignments are turned in as, compiled to HTML or PDF, Jupyter notebooks. In either case open a .py/.ipynb file inside Jupyer Notebook within your current working dirctory. Edit the appropriate file.

If you followed through on step 3, notice that all added or edited files are now marked as modified and/or not tracked. Pushing edits to a repository is a three step process: add, commit, push. We will execute the following status check after each step to help us learn Git as we go.

$ git status

For reasons we won’t explain in this class, before you can finalize your edits we must stage the files we wish to push. Assume you want to submit the file TODO.html. To stage this file execute

$ git add TODO.html

You need to call this command for each new file you want to add.

NB If, in this step, I find that you are taking shortcuts that make my life more difficult I will subtract points from your homework assignment.

Check the status after adding a file.

$ git status

Commiting some changes to your local git directory is the formal way to lock in some edits (locally).

$ git commit -m "a short message describing the edits goes here in quotes"

Check the status after commiting a file.

$ git status

Pushing to your remote repository (the one I can see on GitHub) is the formal way to lock in some edits (remotely).

$ git push

You can confirm that your homework was properly submit by viewing the GitHub repository online. The repository we’ve been working with is located at , which you won’t be able to see because it’s private. It’s highlighted here so you can see that it’s nearly the same link as the one we cloned from.