Trying to clone git - is project name incorrect?

2019-04-15 08:30发布

git clone ssh://user@host:port/project_folder.git
git clone ssh://user@host:port/project_folder/origin.git

Hello! I'm trying to clone remote repository AND always GET ERROR:

Cloning into 'origin'... ssh: connect to host _my_host port _my_port: Connection timed out fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.

connecting via ssh with public/private key is successfull but in that case it asks the passphrase

git does not ask the passphrase

Please, help me understand what i'm doing wrong ....(
A. git does not use ssh key? B. git uses it, but syntax is wrong, should we specify parameter for passphrase? C. project name is wrong? so how to get correct project name??

Remote repositary is not github project.

!!!!!!!!! **DECISION HAS BEEN FOUND: problem is at restricted access for git remote access to this repo. Wandering, why GIT doesn't show explicit reason of such error.. THANK YOU GUYS. THANKS FOR YOUR GOOD ANSWERS, ATTENTION TO OTHER'S QUESTIONS. **

Don't know which of answers to check as decision. What do you think about it?

标签: git ssh
2条回答
我只想做你的唯一
2楼-- · 2019-04-15 09:08

It is a remote server, client have given me ssh access with ssh-keys, git repo is located in subfolder. And that repository has its own remote origin (git status). ssh connection succeeds.

If you know the path of that repo on the remote server, you can try and use, from your local machine, the URL:

 ssh://user@host:port/full/path/to/repo.git

This assume there is a bare repo at the folder /full/path/to/repo.git on the remote server.
And that it is accessible to the user making the remote session.

The OP confirms:

problem is at restricted access for git remote access to this repo.

查看更多
爷、活的狠高调
3楼-- · 2019-04-15 09:24

Following might be some of the issues what you might be facing.

  1. You don't have the proper access rights to the repository that your accessing.

If your a part of the project and your mentor has assigned you to that repository than only you can have an access to it.

You can easily check whether your assigned to that repository or not by typing github.com and followed by the company, group or any specific name where it is hosted.

https://github.com/company_name

Once you hit the above URL and if your able to see the project than your having the proper access to the repository or else not.

  1. Once you verify from Step 1. The next thing is you have to add your public ssh key to git settings.

Navigate to your ~/.ssh folder.

You will find id_rsa and id_rsa.pub. Sometimes you will generate more than one sha keys as you may want to collabrate for your personal git hub account other than your company.

id_rsa.pub is the file content that you need to copy and paste in the github settings.

You can use cat id_rsa.pub to see the content and copy from the command line.

Navigate to your github settings from the top right corner by click on Settings.

Once your on this page on left side bar click on SSH and GPG keys and then add your new SSH key which you had copied.

Now your all good to go with cloning the remote repository.

查看更多
登录 后发表回答