1、使用多个远程代码库,并且使用多个不同的 SSH Key
修改 ~/.ssh/config
Host bitbucket.org
HostName bitbucket.org
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa
User git
Host bitbucket.org-key2
HostName bitbucket.org
IdentityFile ~/.ssh/key2_id_rsa
User git
修改 .git/config
[remote "origin"]
url = [email protected]:XXXX/yyyy.git
fetch = +refs/heads/*:refs/remotes/origin/*
网友评论