I maintain and work on a number of repositories on BitBucket for both work and in my own time and use a separate account for each. SSH is used to talk with the remotes and I use my Multi SSH Key Manager to manage the keys.
The problem with this is that the remotes for all BitBucket repos have the same username and server
email@example.com and as soon as I associate a key for
firstname.lastname@example.org with my work account, I can't associate it with my personal account.
I could link the accounts together and then they could both use the same key but I want to keep them separate, so I needed to find a way of telling Git to use a certain key with a certain remote.
Here's how I did it...