You need to use an SSH key to authenticate against a service which isn't your default SSH key, and/or your default key may be used on another (different) accout for the service.
-
Clone the repo
GIT_SSH_COMMAND='ssh -i ~/.ssh/your-private-key-filename -o IdentitiesOnly=yes' git clone git@....
-
Edit the
.git/config
file within the newly cloned repo. Undercore
add the git SSH command used above assshCommand
:e.g.
[core] repositoryformatversion = 0 filemode = true bare = false logallrefupdates = true ... sshCommand = ssh -i ~/.ssh/your-private-key-filename -o IdentitiesOnly=yes ...