Git: несколько разных ключей для одного хоста на примере bitbucket.org

Всё очень просто, достаточно прописать в ssh-конфиге алиасы:

Host work-bitbucket.org
 HostName bitbucket.org
 IdentityFile ~/.ssh/workid
Host personal-bitbucket.org
 HostName bitbucket.org
 IdentityFile ~/.ssh/personalid

И затем поправить путь к репозиторию гита:

git remote set-url origin git@work-bitbucket.org:repo_name.git

https://confluence.atlassian.com/bitbucket/configure-multiple-ssh-identities-for-gitbash-mac-osx-linux-271943168.html

LEAVE A COMMENT