Git Installation
Fall 2023 | Vin Bui
Last updated
Was this helpful?
Fall 2023 | Vin Bui
Last updated
Was this helpful?
You can access the Cornell GitHub enterprise .
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 to install Git. I personally recommend using the Homebrew approach (requires you to install ), but the Binary Installer should work as well.
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.
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
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>