gpt4 book ai didi

git - 无法使用 git+ssh 克隆

转载 作者:行者123 更新时间:2023-12-02 14:17:14 25 4
gpt4 key购买 nike

我需要通过 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

但它没有用。我还尝试更新 key (其中包含我的公司帐户):
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

关于git - 无法使用 git+ssh 克隆,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59388554/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com