EGR 103/GIT

From PrattWiki
Revision as of 20:47, 9 August 2015 by DukeEgr93 (talk | contribs)
Jump to navigation Jump to search

Introduction

Starting in the Fall of 2015, student in EGR 103 will be using a program called git in order to back up their work for EGR 103 as well as to put their work into a repository that is accessible to the TAs and instructors. While there is naturally some overhead associated with learning how the program works, understanding git is a valuable skill for peole taking EGR 103 to have.

Lab 1 Processes

For EGR 103 for the Fall 2015 semester, students will be using Duke's Git server, gitlab.oit.duke.edu (referred to as Gitlab from this point on), to serve as a host for their git repository. Students will also be pulling a repository from Gitlab which contains files created during lectures and labs as well as files needed for lab each week. The following section goes through the process of setting everything up -- please be careful while following these instructions, and if you have any questions, as a TA or the instructor for help. Getting this set up correctly is about half of the work that will be accomplished during the first lab period for EGR 103.

Setting up your Gitlab account and SSH Keys

To set up your Gitlab account, you will need to log in to Gitlab. To do anything with it, however, you will also need to give Gitlab a piece of code - known as an SSH Key - that Gitlab can use to confirm you are who you say you are. The following will go through the process of setting up your account, generating a key, and adding that key to Gitlab.

  • First, you will need to have a web browser open - it does not matter which one. Navigate to gitlab.oit.duke.edu
  • Do not put your NetID or password in the boxes; instead, click on the "Shibboleth" button: Git Shibboleth.PNG
  • At the Duke Sign In page, Log in using your OIT credentials
  • Click on the Profile Settings icon at the top right - it is the fifth icon from the left and resembles a person: Git Icons.PNG
  • Click on the SSH Keys entry in the menu at the left of the page: Git Keys.PNG
  • Click on the Add SSH Key button at the right of the page: Git AddButton.PNG

Now you will need to generate a key and copy it into this space. To do that, you will need to log in to the Duke Unix machines and then issue Unix commands to have it create a key for you. The following commands will all be in a terminal window:

  • Open MobaXterm and, if need be, start a local terminal
  • At the prompt, type
ssh -XY NetID@login-teer.oit.duke.edu
where NetID is your NetID
  • When prompted, type your password; note that the cursor will not move as you type
  • To create an SSH Key, type:
ssh-keygen -t rsa -C "NetID@duke.edu"
where, again, NetID is your NetID.
  • Accept the default location, which should be /winhomes/NetID/.ssh/id_rsa
  • To see the SSH Key, type:
cat ~/.ssh/id_rsa.pub
  • To copy the SSH Key to your clipboard, simply select the text starting from ssh-rsa and ending with NetID@machine

You will now paste this key into the Key section of the "Add an SSH Key" web page in your browser. You can leave the title as the default case or give it a different name if you wish. Then click the Add Key button: Git AddKey.PNG

From this point forward, when any of the Teer machines interact with your Gitlab account, the keys will be used to verify that you are who you say you are.