Table of Contents

Instructions

GitHub Account

A GitHub account was created for you using your @eng.ucsd.edu email address. Login to GitHub by going to https://github.com/login. Use your @eng.ucsd.edu email address as your username and the password that was assigned to you. You can reset your password by going to https://github.com/password_reset if you don’t have the password that was assigned to you. Please verify your email address by following the instructions at https://help.github.com/articles/verifying-your-email-address/.

Once you have logged into your GitHub account, go to https://github.com/mas-dse and confirm your invitation to the MAS-DSE GitHub Organization.

Install Git

Install Git on your computer using the following directions:

Windows Users should also have Gnu On Windows installed:

Clone the DSE200-notebooks Class GitHub Repository

1. Open the Terminal:

Ubuntu: Open the Terminal program by pressing Ctrl-Alt-t.

Mac OS X: Open the Terminal by clicking on the Spotlight magnifying glass at the top right of the screen, typing “Terminal” then clicking the Terminal icon.

Windows: Go to the Start menu/screen and select the Git Shell program. The Git Shell program may be stored in the GitHub, Inc folder in the Start menu/screen.

2. Type the commands in red to create a directory to store the clone of the DSE 200 Class GitHub Repository. You may store the class repository in a different directory if you prefer.

$ mkdir ~/Documents/DSE
$ cd ~/Documents/DSE

3. Type the command in red to clone the DSE200-notebooks Class GitHub Repository

$ git clone https://github.com/mas-dse/DSE200-notebooks.git

Generate and Add SSH key to GitHub

Ubuntu: Follow the instructions at: https://help.github.com/articles/generating-ssh-keys/#platform-linux

Mac OS X: Follow the instructions at: https://help.github.com/articles/generating-ssh-keys/#platform-mac

Windows: If you logged in to your GitHub account during the setup of GitHub Desktop then your SSH key has already been generated and added to GitHub. If you didn’t login to your GitHub account during setup then follow the directions at: https://help.github.com/desktop/guides/getting-started/authenticating-to-github/#platform-windows

Clone your MAS-DSE Private GitHub Repository

Complete the Generate and Add SSH key to GitHub instructions before attempting to clone your MAS-DSE Private GitHub Repository.

1. Type the command in red to print out the list of private repositories your have access to in the MAS-DSE GitHub organization. Replace GITHUB_USERNAME and GITHUB_PASSWORD with your GitHub Username and Password.

$ curl -s -i -u GITHUB_USERNAME:GITHUB_PASSWORD https://api.github.com/orgs/MAS-DSE/repos?type=private | grep ssh_url
"ssh_url": "git@github.com:mas-dse/REPOSITORY_NAME.git"

2. The SSH URL for your private repository is the ssh_url from step 1 that contains your @eng.ucsd.edu E-mail username. Copy the ssh_url, with out the quotation marks for step 3.

3. Type the commands is red to clone your empty private GitHub repository. You will need to substitute git@github.com:mas-dse/REPOSITORY_NAME.git with the actual SSH URL for your private repository from step 1.

$ cd ~/Documents/DSE/
$ git clone git@github.com:mas-dse/REPOSITORY_NAME.git
Cloning into 'REPOSITORY_NAME'...
warning: You appear to have cloned an empty repository.
Checking connectivity... done.

4. Type the command in red to enter the local clone of your private GitHub repository. Replace REPOSITORY_NAME with the name of your repository, which should be your @eng.ucsd.edu E-mail username.

$ cd REPOSITORY_NAME

Copy and Save the Content from the DSE200-notebooks Repository to your Private GitHub Repository

1. Type the command in red to copy the contents of the DSE200-notebooks repository to your private GitHub repository.

$ cp -R ~/Documents/DSE/DSE200-notebooks/* DSE200/

2. Type the commands in red to add and commit the DSE200-notebooks files to your local private GitHub repository.

$ git add DSE200/*
$ git commit -m "Added the DSE200-notebooks files to /DSE200/"

3. Type the commands in red to push the changes to your private GitHub repository on github.com.

$ git push origin master

Tips for Syncing your Local Private GitHub Repository with the DSE200-notebooks Class GitHub Repository

Use rsync or robocopy to copy new files added to DSE200-notebooks Class GitHub Repository

NOTE: This method will only copy new files added to the DSE200-notebooks Class GitHub repository. If the file already exists in your local private GitHub repository then you will need to manually copy the file from the DSE200-notebooks Class GitHub repository to your local private GitHub repository.

1. Type the commands in red to download the latest changes from the DSE200-notebooks Class GitHub repository.

$ cd ~/Documents/DSE/DSE200-notebooks
$ git pull

2. Type the commands in red to copy the new files from the DSE200-notebooks Class GitHub repository to your local private GitHub repository. Replace REPOSITORY_NAME with the name of your private GitHub repository.

Ubuntu & Mac:

$ cd ~/Documents/DSE/REPOSITORY_NAME

$ rsync -a --ignore-existing ../DSE200-notebooks DSE200

Windows:


> cd ~/Documents/DSE/REPOSITORY_NAME

> robocopy ..\DSE200-notebooks DSE200 /E /XC /XN /XO

Follow the DSE200-notebooks Class GitHub Repository Commit Log

New updates to the DSE200-notebooks Class GitHub Repository can be viewed at: https://github.com/mas-dse/DSE200-notebooks/commits/master

Troubleshooting

Permission denied (publickey)

If you receive a Permission denied (publickey) error see the following: https://help.github.com/articles/error-permission-denied-publickey/