xshaun's NoteBook

What makes the desert beautiful is that somewhere it hides a well.

Follow me on GitHub

问题

如何给一个github project增加指定密钥

解法

git remote set-url origin 'ext::ssh -i ~/.ssh/<key_id> git@github.com %S <github username>/<github projectname>.git'

或者 直接修改项目下 .git/config 文件

[remote "origin"]
        url = ext::ssh -i ~/.ssh/<key_id> git@github.com %S <github username>/<github projectname>.git

PS: 注意 只需要修改尖括号里的内容,然后去除尖括号,不要增加多余的 slash /


GO-BACK     UP-LEVEL TOP