Git GitHub Add SSH
Add SSH to GitHub
Now that you have generated your SSH key, you need to add your public key to your GitHub account.
Copy Your Public SSH Key
- On Windows (Git Bash):
clip < ~/.ssh/id_rsa.pub
- On macOS:
pbcopy < ~/.ssh/id_rsa.pub
- On Linux:
cat ~/.ssh/id_rsa.pub
(then copy manually)
Important: Complete these steps before you attempt to push, pull, or clone with SSH. This page assumes you have already generated your SSH key and added it to your SSH agent. If not, go back to the SSH setup section in the Getting Started guide.
Add the Key to GitHub
- Go to GitHub, click your profile in the top right, and select Settings:
- In the sidebar, select SSH and GPG keys and click the New SSH key button.
- Give your key a descriptive title, paste your public SSH key into the "Key" field, and click Add SSH Key.
You may be prompted to supply your GitHub password or use 2FA to confirm the addition.
You will see your new SSH key listed:
Next, you'll test your SSH connection and set your GitHub remote origin using SSH.