In order to push/pull from GitHub using SSH, I have to...
$ eval $(ssh-agent -s)
$ ssh-add ~/.ssh/git_id_rsa
$ git push origin master
However, when I push/pull to remote git repositories I host on my own private server, I can skip the whole ssh-agent
stuff and simply
$ git push origin master
How do I do the same with GitHub (push/pull without ssh-agent
set-up and ssh-add
)?
You can use config file in .ssh directory of your user in order to configure key for particular server:
# ~/.ssh/config
Host github.com
IdentityFile ~/.ssh/git_id_rsa
You can find more detail on Simplify Your Life With an SSH Config File.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With