Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/github/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
需要将GIT存储库克隆到远程服务器_Git_Github_Git Clone_Git Repo - Fatal编程技术网

需要将GIT存储库克隆到远程服务器

需要将GIT存储库克隆到远程服务器,git,github,git-clone,git-repo,Git,Github,Git Clone,Git Repo,我需要通过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)

我需要通过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) 这是一个公共回购。

首先,如果它是一个公共存储库,您应该能够通过https URL克隆它

git clone https://github.xyz.com/username/repository.git
其次,要了解SSHURL失败的更多原因,请将
GIT\u SSH\u命令设置为
SSH-v

然后再次克隆,并检查错误消息


A
ssh-Tvgit@github.xyz.com
应打印您的姓名。如果不是,如评论所述,您需要在github.xyz.com上的配置文件中注册您的
~/.ssh/id_rsa.pub
公共ssh密钥。如果是公共repo,为什么要隐藏其URL?听起来您可能需要添加ssh密钥,很可能是ssh密钥问题。以防万一,请确保您可以从远程服务器访问github。在这里,他们设法解决了一些非常相似的问题: