[Github] 用不同RSA key pair去提交push request

# 一般github建repo都會配成這樣的remote 
# git remote add origin [email protected]:/.git

# push代碼的時侯會默認用./ssh/id_rsa和id_rsa.pub
git push origin master
# 如果你想用不同用戶和rsa key pair去提交代碼,你需要
# 1. 增加下面 ~/.ssh/config
Host github.com-user2
    HostName github.com
    User git
    IdentityFile ~/.ssh/id_rsa_user2
# 2. 修改origin url
git remote rm origin
# 注意:這裡的hostname是github.com-user2,而不是github.com
git remote add origin [email protected]:/.git

``sh

你可能感兴趣的:([Github] 用不同RSA key pair去提交push request)