Configuring a Different SSH Key per Git Repository [updated]

Usecase: you need to manage multiple git accounts (e.g. private and work), with each their own SSH key.

Example: you use host Bitbucket privately, and your firm starts using Bitbucket as well. Or client B has set up an account for you, which uses the same host you’ve already used.

Fabian Keller has a simple way of working with this. Check out

Initial clone with alternative key

If you want to make that initial call, without already having set up a local git repo, use the following call:

git clone --config core.sshCommand="ssh -F ~/.ssh/config-bitbucket-my-work"

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.