- Generate SSH key
ssh-keygenSelect 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= dmitry.barskov@flatstack.com
- Replace HTTPS remotes with SSH
git remote remove origin
git remote add origin git@github.com:fs/rails-base-graphql-api.gitPros:
- Secure
- Don't need to log in every time