As a professional software developer you work on different projects for distributed clients.
You have to deal with many source code management services and ssh keys.
For my case i have a professional ssh key and a personal one. I would like to be able to just run git push or pull without specifying the ssh-key to use and git will figure out the rest.
We can use the environment variable to switch the ssh-key used by git the authenticate push & pull requests.
GIT_SSH_COMMAND="ssh -i /path/to-your/ssh-key" git push your-origin your-branch
We all agree that it's boring to always specify the ssh key. Thanks to the community, git has a sshCommand configuration variable. We will use it and configure a per project ssh key.
git config core.sshCommand "ssh -i /path/to-your/ssh-key"