简体   繁体   English

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

[英]Need to clone a GIT repository into remote server

I Need to clone a GIT repository into remote server via SSH.我需要通过 SSH 将 GIT 存储库克隆到远程服务器。 I have tried doing this in the traditional way, using我尝试以传统方式执行此操作,使用

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

The above gave me以上给了我

fatal: Could not read from remote repository.

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

1)Repo exists, I created the repo for test purpose 2)it's a public repo. 1)repo 存在,我为测试目的创建了 repo 2)它是一个公共 repo。

First, if it is a public repository, you should be able to clone it through https URL首先,如果它是公共存储库,您应该可以通过 https URL 克隆它

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

Second, to know more about why your SSH URL fails, set GIT_SSH_COMMAND to ssh -v .其次,要了解有关 SSH URL 失败原因的更多信息,请将GIT_SSH_COMMAND设置为ssh -v
Then clone again, and check the error messages.然后再次克隆,并检查错误消息。

A ssh -Tv git@github.xyz.com should print your name.一个ssh -Tv git@github.xyz.com应该打印你的名字。 If not, as commented, you need to register your ~/.ssh/id_rsa.pub public SSH key to your profile on github.xyz.com .如果没有,如评论中所述,您需要将您的~/.ssh/id_rsa.pub公共 SSH 密钥注册到您在github.xyz.com上的个人资料。

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

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