- Generate SSH key
ssh-keygen
Select file location, passphrase (I prefer empty)
- Copy the key
cat "$HOME/.ssh/id_rsa.pub" | pbcopy
- Visit GitHub Settings and add the key Example:
Title:
Personal Macbook Air 2015
Key:
ssh-rsa AAA...JaE= [email protected]
- Replace HTTPS remotes with SSH
git remote remove origin
git remote add origin [email protected]:fs/rails-base-graphql-api.git
Pros:
- Secure
- Don't need to log in every time