When you run:
git pull
Git asks every time:
This is annoying and slows you down.
SSH lets you connect to Git without entering credentials every time.
Run:
ls ~/.ssh
If you see files like:
๐ You already have an SSH key (skip to Step 3)
Run:
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
Press Enter for all prompts.
๐ This creates:
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
Creates:
๐ Used for GitHub login without password
Run:
cat ~/.ssh/id_rsa.pub
Copy the output.
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMyZ5kK8sJf8J7xK3lD9abcXYZ1234567890 your_email@example.com
Check current remote:
git remote -v
If it shows HTTPS like:
https://github.com/user/repo.git
Change it to SSH:
git remote set-url origin git@github.com:user/repo.git
Run:
ssh -T git@github.com
You should see:
Hi username! You've successfully authenticated...
Now try:
git pull
โ No username โ No password โ Super fast
If you use multiple accounts, you can configure multiple SSH keys using:
~/.ssh/config