【问题标题】:Need to clone a GIT repository into remote server需要将 GIT 存储库克隆到远程服务器
【发布时间】:2019-12-10 21:52:44
【问题描述】:

我需要通过 SSH 将 GIT 存储库克隆到远程服务器。我尝试过以传统方式执行此操作,使用

git clone git@github.xyz.com:username/repository.git

上面给了我

fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

1)repo 存在,我创建了 repo 用于测试目的 2)它是一个公共回购。

【问题讨论】:

  • 如果它是一个公共仓库,为什么要隐藏它的 URL?
  • 听起来您可能需要将 SSH 密钥添加到 github.com/settings/ssh
  • 听起来很可能是 SSH 密钥问题。以防万一,请确保您可以从远程服务器访问 github。在这里,他们设法解决了一些非常相似的问题:stackoverflow.com/questions/30068298/…

标签: git github git-clone git-repo


【解决方案1】:

首先,如果是公共仓库,你应该可以通过https URL克隆它

git clone https://github.xyz.com/username/repository.git

其次,要详细了解 SSH URL 失败的原因,请将 GIT_SSH_COMMAND 设置为 ssh -v
然后再次克隆,并检查错误信息。

ssh -Tv git@github.xyz.com 应该打印您的姓名。如果没有,如评论所述,您需要将您的 ~/.ssh/id_rsa.pub 公共 SSH 密钥注册到您在 github.xyz.com 上的个人资料。

【讨论】:

    猜你喜欢
    • 2013-06-24
    • 1970-01-01
    • 2018-03-02
    • 2023-03-04
    • 2011-01-26
    • 2011-04-23
    • 1970-01-01
    • 2011-06-01
    • 1970-01-01
    相关资源
    最近更新 更多