git config --local user.name "Local Name"
问题在于,当我推送到不同的仓库时,相同的ssh密钥不起作用。如果我更改一个仓库的ssh密钥,那么使用相同的ssh密钥推送到另一个仓库将会出现问题。该如何解决?
.ssh/config
文件以指向2个不同的身份。
Host foo foo.example.com
Hostname foo.example.com
IdentityFile ~/.ssh/foo_rsa
Host bar bar.example.org
Hostname bar.example.org
IdentityFile ~/.ssh/bar_rsa
git pull
这样的调用,由于每个仓库都有不同的站点,Unix 将使用不同的身份文件。 - First Zero