I recently set up an SSH key for by Bitbucket account, which works very nicely. But I also have other git repos like Github, GitLab (non ssh at the moment) and I came to push to one of those other accounts and I think the Terminal defaulted to use my bitbucket ssh keys.
So how would I force Terminal to either let me login with a username and password when using a github repo, or let me pick which ssh keys to use, say I had setup up keys for Gitlab and Github?
Best Answer
There a different ways of achieving this.
you could use the same key for all your git repos.
you could use different keys and specify which one to use when logging into a remote system:
I would create a key pair for each git repo, then in Bitbucket you would upload the key to the Bitbucket website. Gitlab and Github work the same way.
Once you uploaded your key to your repository it is enough to
git push
without need to specify your key.