繁体   English   中英

无法使用 git+ssh 进行克隆

[英]Unable to clone with git+ssh


我需要通过 git+ssh (git+ssh://git.host.repository.com) 克隆一个存储库。 它失败了,因为它使用我的操作系统用户名而不是我的组织用户名。

Cloning into 'project.name'...
francesco@git.host.repository.com's password:

“francesco”是我的操作系统帐户名,显然无法登录。 在 ~/.ssh/config 我添加了:

IdentityFile ~/.ssh/id_rsa.pub

但它没有用。 我还尝试更新密钥(其中包含我的公司帐户):

touch ~/.ssh/id_rsa.pub

它仍然尝试使用操作系统用户名而不是公钥中包含的用户名登录。 有什么帮助吗?

您应该编辑类似于下面的 ssh 配置配置文件。 User可以强制用户使用ssh

Host git.host.repository.com
  HostName git.host.repository.com
  User git
  IdentityFile ~/.ssh/github/id_rsa

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM