
您可以使用任意名称创建两个公用/专用密钥:
~/.ssh repo1 repo1.pub repo2 repo2.pub config
(即,不必命名
id_rsa(.pub)即可工作,只要您指示ssh可以在哪里查看即可。
这就是’
config‘发挥作用的地方:该
config文件包含GitHub
repo1和GitHub的两个连接的名称
repo2,每个连接都有一个私有存储库密钥的路径,如“更改github帐户mac命令行”和“
快速提示:如何使用GitHub和多个帐户 ”中所述:
Host githubRepo1HostName github.comUser gitIdentityFile ~/.ssh/repo1Host githubRepo2HostName github.comUser gitIdentityFile ~/.ssh/repo2
这样,您就可以从两个存储库中提取任何一个,只要您使用它们的ssh地址即可。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)