我遵循了一个教程,所以我可以在同一台机器上有两个单独的 git hub 用户,我在 ssh 文件夹中创建了一个配置:
#Default GitHub
Host <span class="skimlinks-unlinked">github.com</span>
HostName <span class="skimlinks-unlinked">github.com</span>
User git
IdentityFile ~/.ssh/id_rsa
Host github-panthro
HostName <span class="skimlinks-unlinked">github.com</span>
User git
IdentityFile ~/.ssh/id_rsa_panthro
但是现在当我尝试使用 ssh 时,我得到了错误:
config line 3: garbage at end of line; "class".
我已经清理了删除空格的类,但错误仍然存在。
最佳答案
按如下方式删除 Span,它应该可以工作。我有类似的配置文件。
Host github.com
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa
Host github-panthro
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa_panthro
关于git - ssh配置格式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25442612/