Skip to content

Latest commit

 

History

History
122 lines (88 loc) · 5.72 KB

github-setup.md

File metadata and controls

122 lines (88 loc) · 5.72 KB

Setting up your own GitHub Account

Approved for: Fall 2019

In this tutorial, we will walk you through creating your own GitHub account, creating a private repository (so your code won't be publicly visible on the web), and cloning and pushing content to your private, online repository.

Note: You should never create a public repository for work that you are doing for a class.

Setting up an Account

As students, you receive free access to GitHub Pro while you a student. To set up your account:

  1. Click Here
  2. Click on "Yes, I'm a Student"
  3. Fill out the form and submit for review
  4. Wait on email confirmation from GitHub. Hopefully, this will take less than a day.

Setting up SSH Keys

Before you can push and pull to private repositories hosted on GitHub from your Nike account, you will need to create an SSH public/private key pair on Nike. This will allow you to give a public key to GitHub (think of it as a padlock) that GitHub can use to authenticate your requests in addition to or in lieu of your GitHub username and password. It's sufficient to think of this key-based authentication process as you unlocking the public key (i.e., the padlock) using your private key -- the Git program will do this with GitHub so long as the key pair is setup correctly.

  1. Login to Nike.

  2. Execute the command below, replacing your_email@uga.edu with your @uga.edu email address. Do NOT change any values when prompted -- simply press return until the command is finished executing.

    $ ssh-keygen -t rsa -b 4096 -C "your_email@uga.edu"
    

    This creates a public / private key pair in the default location: ~/.ssh/.

  3. View your public key using cat and copy its output to your clipboard (usually by selecting the text in your terminal, then right clicking on the selection and clicking "Copy"):

    $ cat ~/.ssh/id_rsa.pub
    
  4. Login to GitHub.

  5. In the upper-right corner of any page, click your profile photo, then click Settings.

  6. In the user settings sidebar, click SSH and GPG keys.

  7. Click New SSH key or Add SSH key.

  8. In the "Title" field, add a descriptive label for the new key. For example, if you're adding a key for your Nike account, then you might call this key "Nike".

  9. Paste your key into the "Key" field. This should be the copied output from your prior call to cat.

  10. Click Add SSH key.

  11. If prompted, confirm your GitHub password.

Creating a Repository

  1. Login to GitHub
  2. Click on "New" under the repositories section on the left-hand side of the page.
  3. You should see a screen similar to the image below. Type cs1302-testRepo as the name of your repository, click the "private" radio button and then press the "Create Repository" button.

Create Repo

  1. Once you've clicked the "Create Repository" button, your repository is created but still needs to be setup. GitHub should be showing a website which gives you a few options on how to setup your repository. Instead of following those instructions directly, we will setup our repository from Nike using the following commands:

    1. Clone your repository on nike using git clone git@github.com:username/cs1302-testRepo.git replacing username with your GitHub username. You may get a message saying you've cloned an empty repository. That's okay! You should now have a folder called cs1302-testRepo.
    2. Change into the cs1302-testRepo directory.
    3. Create an initial README file using echo "# cs1302-testRepo" >> README.md.
    4. Add your README file to the repository using git add README.md.
    5. Commit your changes using `git commit -am "first commit".
    6. Push your changes to GitHub using git push origin master
    7. Refresh your GitHub page to see the changes to the repository. Your repository should look similar to the below image. Note the number of commits (1 so far) to this repository, the latest commit time, and the contents of the README file are all shown on GitHub.

Test Repo

  1. Now that your repository is set up, let's get some more pracice. On Nike, do the following:
    1. Open your README.md file.
    2. Type a few additional sentences.
    3. Commit your changes locally.
    4. Push your changes to GitHub.
    5. Refresh the GitHub page to make sure your changes have been added to the online repository.
    6. Delete the entire cs1302-testRepo folder from Nike.
    7. Wait. Delete my entire project from Nike?!? Yep, do it.
    8. Execute the git clone command from above. And it's back!
    9. Note: you could clone from any machine that has git installed. You've all been cloning cs1302 GitHub repositories all semester.

Congratulations on becoming a member of GitHub!


License: CC BY-NC-ND 4.0

Copyright © Michael E. Cotterell, Brad Barnes, and the University of Georgia. This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License to students and the public. The content and opinions expressed on this Web page do not necessarily reflect the views of nor are they endorsed by the University of Georgia or the University System of Georgia.