跳转到内容

欢迎来到Riguz的小站!这是一个私人wiki,用来记录一些我的笔记。

Git:配置多个SSH证书

来自WHY42

为多个不同的git repository配置不同的SSH key:

~/.ssh/config

Host github.com
    HostName github.com
    User git
    IdentityFile ~/.ssh/id_ed25519

Host github.com-xxx
    HostName github.com
    User git
    IdentityFile ~/.ssh/id_rsa

然后需要将repository的地址进行替换:

git remote set-url origin git@github.com-xxx:XXX/XXXX.git