Git: Passwordless Push to GitHub
Every time I need to set up passwordless push to GitHub on a new machine, I had to perform many Google searches and read many instructions on different pages. I can't simply find simple instructions on a single page. So this snippet was born.
Here are the three steps to set up passwordless push to GitHub:
- Generate an SSH key:
ssh-keygen -t ed25519 -C "me@domain.com"
. - Add the public key from
~/.ssh/id_ed25519.pub
to your GitHub account. - Change your git remote url
git remote set-url origin git@github.com:<org>/<repo>.git
.