Using different SSH keys for multiple git accounts
Previously, adding an SSH key for git usage has required use of the SSH configuration file, or a git environment variable. These were limited in that that you could only have one key per host (SSH) or globally (git). These limit their usefulness when using multiple accounts with github, for example
Since git 2.10, it is possible to specify a key to use in git config, and therefore on a per-repo basis.
git config core.sshCommand "ssh -i ~/.ssh/id_rsa_example -F /dev/null"
git pull
git push
From superuser.com
Written by davewatts
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Git
Authors
khasinski
591.1K
dmichaelavila
500.4K
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#