0

我正在服务器中“尝试”这个:

# ~/.ssh/config
Host github.com
  IdentityFile xxxx

xxxx当我在服务器中执行时,我应该输入什么:

git clone git@github.com:myuser/myrepo.git

Git 在我的本地而不是在服务器中使用身份,该身份位于~/.ssh/my_another_private_key_file并且不使用默认密钥~/.ssh/id_rsa

4

1 回答 1

3

这应该放在您正在执行 git clone 的机器上的 ~/.ssh/config 文件中:

Host github.com
  IdentityFile ~/.ssh/my_another_private_key_file

如果您在服务器上进行克隆并且 my_another_private_key_file 位于本地,您可能希望将其添加到服务器上的 ~/.ssh/identity 中,因此当您在那里 ssh-add 时,它会被添加到您的 ssh-agent过程。

于 2013-10-11T23:23:11.187 回答