Reputation: 43
I Need to clone a GIT repository into remote server via SSH. 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.
Upvotes: 2
Views: 2474
Reputation: 1328912
First, if it is a public repository, you should be able to clone it through 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
.
Then clone again, and check the error messages.
A ssh -Tv git@github.xyz.com
should print your name. If not, as commented, you need to register your ~/.ssh/id_rsa.pub
public SSH key to your profile on github.xyz.com
.
Upvotes: 2