by AndyJames · 4y ago · 0 comments
git clone -c "core.sshCommand=ssh -i ~/.ssh/bitbucket-work -F /dev/null" git@bitbucket.com:example/example
For existing repo:
git config core.sshCommand "ssh -i ~/.ssh/bitbucket-work -F /dev/null"
Where "bitbucket-work" is the name of the key for that particular repo.
This is in the context of go modules but it works with regular git stuff.
$ git clone git@workspace.bitbucket.org:workspace/repo.git
I haven't tried with GitHub as I only have one account I use there.