Solution to PS0: Demonstration Assignment


0. Create a GitHub account

If you do not already have an account on GitHub, go to www.github.com and create one.


1. Clone the assignment git repository.

First, go to the problem sets page in Canvas or the course website and click on the “View on GitHub” button for this assignment.

Then click on the link to go to the assignment repository on GitHub and copy the clone link. Make sure to use the HTTPS link.

Finally, go to the class JupyterHub at jhub.dartmouth.edu, open a new terminal, and use the command git clone <clone_link>, where <clone link> represents the link you just copied from the GitHub website.


2. Create a new file called hello.md

In Jupyter, go to the file browser, navigate to the demonstration-<username> folder and create a new file names hello.md.

Add a single line containing the text “Hello World!” and save it.


3. Commit and push hello.md

  • Go back to the terminal you opened earlier and change directory (cd) into the repository folder by typing cd demonstration-<username>. You can see the list of files and folder in the current directory with the ls command.
  • Then type git status to see any changes that might have been made. You should see your new hello.md in the untracked category. Running git add will stage the file and tell git we want to start tracking it.
  • To commit the file (e.g., save a version of it), we’ll run git commit -m "Added file hello.md". Everything in quotes is just a message for us to keep track of what changed in this command. If this is the first time you’ve committed anything with git, you might be asked to set your email. This is only necessary once.
  • Finally, we’ll synchronize our local copy of the repository with the one stored on the “GitHub” server.


4. Make sure everything worked

Go back to the repository on GitHub and check to see if hello.md exists.