When I do git pull
via the command line, it always asks for my github username and password. I'd like to tell it to use the ssh key in github, and never have to worry about it again. How do you do this?
Assuming that you have used ssh-keygen
to generate a key pair and uploaded the public key in the appropriate place in your github account, you should be able to set remote to use the url git@github.com:username/repo.git
.
git remote set-url origin git@github.com:username/repo.git
If you do not have local changes that you care about, you can just delete your local repository and clone again:
git clone git@github.com:username/repo.git
Here are github's instructions on this setup, which you can use as a reference as needed.