CO Lab Manual
Course Page
  • Course Information
    • Welcome
    • Introduction
    • Your Contributions
    • Lab Sessions and Etiquette
    • Team Setup
    • Assumed Prior Knowledge
  • Setup Guides
    • GitHub Repository Setup
    • Technical Setup
      • Windows
      • Linux
      • macOS
    • GitHub SSH Setup
    • Framework Setup
  • Reference Documentation
    • Introduction to the Documentation
    • A Brief History Lesson
    • Syntax (Intel vs. AT&T)
      • Section Exercises
    • Memory
      • Memory Management
      • Section Exercises
    • Registers
      • Section Exercises
    • Instructions
    • Subroutines
      • Calling Subroutines
      • Writing Subroutines
      • Section Exercises
    • Input/Output
      • Printing to the Terminal
      • Reading from the Terminal
      • Section Exercises
    • Programming Constructs
    • Assembler Directives
    • C/C++ vs Assembly
    • Building and Running Programs
    • Address Sanitization
    • A0: A Running Example
  • Assignments
    • Introduction to the Assignments
    • Mandatory Assignments
      • A1: Subroutines and I/O
      • A2: Recursion
    • Extra Assignments
      • A3-a: Fibonacci Calculator
      • A3-b: Fibonacci REPL
      • A4: Diff
      • A5: Printf
      • A6: HPC
      • A7: Bitmap
      • A8: Game
  • Appendix
    • Acknowledgments
    • Rules and Regulations
    • Frequently Asked Questions
    • How to use a Debugger
Powered by GitBook
On this page
  • Step 1: Generate SSH Keypair
  • Step 2: Add Public Key to GitHub
  • Step 3: Configure Git
  • Step 4: Clone Your Repository
  1. Setup Guides

GitHub SSH Setup

PreviousmacOSNextFramework Setup

Last updated 4 months ago

One of the most convenient ways to give your computer access to your GitHub account (and with that to your private repositories) is to set up a Secure Shell (SSH) key. The initial process may be a bit intimidating at first, but if you follow all steps exactly as described, you should not run into any issues.

Note: For Windows users, it is essential that you run all given commands from your WSL terminal. If you are not sure whether you are in your WSL terminal, enter the uname command. If you are on WSL, the output should be "Linux", while a Windows terminal will give you an error.


Step 1: Generate SSH Keypair

  1. Enter ssh-keygen -t ed25519 -C "<your_email>" and replace <your_email> with the email address used for your GitHub account (but make sure to keep the quotes around the email).

  2. When prompted for where to save the key, simply press enter.

  3. When prompted for a passphrase either give it a passphrase (but make sure you remember it) or leave it empty and press enter (twice).

  4. Enter eval "$(ssh-agent -s)"

  5. Enter ssh-add ~/.ssh/id_ed25519

  6. Enter cat ~/.ssh/id_ed25519.pub (make sure to include the .pub in the filename) The output should look something like: ssh-ed25519 [...] <your_email>

  7. Copy the output of the previous command (in WSL (Windows) you can copy highlighted text by right-clicking)


Step 2: Add Public Key to GitHub

Now open in your browser and follow the remaining steps:

  1. Click on your user icon and select "Settings".

  2. Click on "SSH and GPG Keys" in the sidebar.

  3. Click the green "New SSH key" button.

  4. Give the key some name (e.g., WSL or MacBook)

  5. Paste the output from the cat command executed earlier into the "Key" field.

  6. Click "Add SSH key"


Step 3: Configure Git

Return to your terminal window and execute the following steps to finish the setup:

  • git config --global user.email "<your_email>"

  • git config --global user.name "<your name>"

where you replace <your_email> with the email used for your GitHub account (and used during the SSH setup) and <your name> with either your GitHub username or your full name depending on your preference.

Done! You should now be ready to go with your Git and GitHub setup.


Step 4: Clone Your Repository

To clone a repository you can simply use the following command:

git clone git@github.com:<username>/<repo>.git

<username> is your GitHub username and <repo> is the name of your repository. You can also copy this command from the GitHub website of your repository using the green "Code" button and then the "SSH" tab.

The first time you use this command, your terminal will warn you that the authenticity of github.com can't be established. This is because you are using the SSH keypair for the first time. Simply type yes and continue.

Note: You should do this step after completing the .

GitHub
GitHub Repository Setup