1️⃣Git Installation
Fall 2023 | Vin Bui
Cornell GitHub
You can access the Cornell GitHub enterprise here.
Install Git (skip this step if you already have Git installed)
To check to see if you have git installed, open Terminal and run git --version
. A message will display if you already have it installed.
Follow the instructions here to install Git. I personally recommend using the Homebrew approach (requires you to install Homebrew), but the Binary Installer should work as well.
Generate SSH Key
Log in to your GitHub. Go to Settings > SSH and GPG Keys. Create a New SSH key.
Keep the page open. Open up Terminal and execute the two commands (replace YOUR NAME and YOUR GITHUB EMAIL):
git config --global user.name "YOUR NAME"
git config --global user.email "YOUR GITHUB EMAIL"
To generate an SSH Key, type
ssh-keygen -t ed25519 -C "YOUR GITHUB EMAIL"
Press enter when asked: “Enter file in which to save the key”.
If asked “[…]/.ssh/id_ed25519 already exists. Overwrite (y/n)?”, type y and press enter.
Note: If you have previously configured SSH authentication for other services, overwriting your current key will likely cause you to lose access. You will need to reconfigure that service to authenticate using the new key in order to regain access.
When asked: “Enter passphrase (empty for no passphrase):” just press enter.
When asked: “Enter same passphrase again:” just press enter.
Copy the generated key to your clipboard by typing
pbcopy < ~/.ssh/id_ed25519.pub
Go back to the GitHub page from earlier. For the Title field, I recommend putting the name of your device (such as “Vin’s Macbook”). The key type is Authentication Key. Paste the generated key, then click Add SSH key.
Configure SSH Agent
For newer Macs (12, Monterey/Ventura), run
ssh-add --apple-use-keychain ~/.ssh/id_ed25519
If that command fails, try
ssh-add --apple-use-keychain ~/.ssh/id_rsa
For older Macs (11, Big Sur), run ssh-add -K ~/.ssh/id_ed2551
If that command fails, try
ssh-add -K ~/.ssh/id_rsa
Cloning a repository (not needed for installation)
Open up Terminal and change the directory to wherever you want the repository files to be located. You can change the directory using the cd
command.
For example, if I want the repository files to be located in my Desktop, I would type
cd Desktop
To clone a repository, simply type git clone <ENTER URL HERE>
Last updated