Rumah > Soal Jawab > teks badan
我有多个 github 账号,分别设置了不同的 SSH key,one_rsa
和 two_rsa
那么,在对 git 项目进行操作时,如何保证不冲突呢?
迷茫2017-04-28 09:05:57
Gunakan ssh config (ssh_config Recipes). Cipta fail .ssh
baharu dalam direktori config
dan konfigurasikan kekunci yang berbeza untuk hos yang berbeza
Host gitcafe.xxx
HostName gitcafe.com
User git
IdentityFile ~/.ssh/id_rsa_gitcafe_xxx
Host gitcafe.yyy
HostName gitcafe.com
User git
IdentityFile ~/.ssh/id_rsa_gitcafe_yyy
Host github.xxx
HostName github.com
IdentityFile ~/.ssh/id_rsa_github_xxx
# 此行是代理配置,请无视
ProxyCommand ~/.ssh/socksproxywrapper.sh %h %p
Sebagai contoh, jika ialah kunci pengguna id_rsa_github_xxx
anda pada github
, anda boleh menggunakan xxx
git clone git@github.xxx:xxx/project.git
Cara ini untuk menarik item pada . github