Using SSH for GitHub on Mac
Sep 29, 2023
Generate SSH Key
ssh-keygen -t ed25519 -C "your_mail@example.com" # Enter your passphrase
eval "$(ssh-agent -s)"
nano ~/.ssh/config
Add the following in the config file
Host github.com
AddKeysToAgent yes
UseKeychain yes
IdentityFile ~/.ssh/id_ed25519
ssh-add --apple-use-keychain ~/.ssh/id_ed25519
Add public key to GitHub
Command + Shift + . to see the hidden files
Go to /Users/user_name/.ssh/
Find the file id_ed25519.pub
Cope the content or just the following command to copy automatically
pbcopy < /Users/user_name/.ssh/id_ed25519.pub
GitHub.com -> Settings -> SSH Keys -> Put your key there