Saving and Uploading Content

Once you have made changes to an assignment and are ready to save your progress, there are a few steps that you must do prior to closing the hub if using git to keep your changes save. Once again, the interaction with git can be via Plugin user interface or a terminal session

1. Saving your work using GIT Plugin (UI)

Saving your changes and uploading them to GitHub is outlined and illustrated below:

  1. Once all files have been staged, you can commit your changes by typing a commit message

Committing changes does not automatically save them to the repository! Don't forget to do step 5 and push the changes.

2. Saving your work using GIT command line

2.1: Open terminal and move to working assignment directory

  1. Launch a terminal on JupyterHub

  2. Navigate to your current working assignment directory using the cd command

cd assignmentDirectory

2.2: Commit Changes to be Saved (git add/commit)

From the directory containing your actively worked on assignment, you must first add and commit changes you have made which will be prepared to be saved remotely on the git repository. Think of this as staging any changes you have made, but not actually saving them yet. This first step provides the opportunity to add a commit message where you can document the changes you have made with this current save, which should be descriptive but not necessarily comprehensive.

git commit -a -m "Notes about changes"

Committing changes does not automatically save them to the repository! Don't forget to do step 3 and push the changes.

The -m flag means you are passing a commit message, which must be inside double quotes. If you forget to pass the message, it will launch the terminal editor emacs. You can type your message, save with Ctrl/Cmd+x then Ctrl/Cmd + s and quit using Ctrl/Cmd + x then Ctrl/Cmd + c

2.3 Save Changes to Repository (git push)

Once the changes have been stage following Step 2, the last step is to actually save the changes to the remote repository using the push command.

$ git push

It will require you to enter your github credentials and then will begin to save the changes to your remote repository for the git classroom.

It is recommended that you git commit and push at the end of each working session or whenever a major change has been made to the codebase.

Last updated