Git error: “Please make sure you have the correct

2019-03-08 22:26发布

I am using TortoiseGit on Windows. When I am trying to Clone from the context menu of the standard Windows Explorer, I get this error:

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

More precisely, the snapshot of terminal is the following:

git.exe clone --progress -v "git@arobotdev:\git\AlfaRobot.git" "C:\Work\AlfaRobot"

Cloning into 'C:\Work\AlfaRobot'...
Permission denied, please try again.
Permission denied, please try again.
Permission denied (publickey,password).
fatal: Could not read from remote repository.

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

git did not exit cleanly (exit code 128) (21450 ms @ 19.09.2014 10:36:58)

What should I do to make git work properly ?

14条回答
Root(大扎)
2楼-- · 2019-03-08 22:49

For me it was because of no SSH key on the machine. Check the SSH key locally:

$ cat ~/.ssh/id_rsa.pub

This is your SSH key. Add it to your SSH keys in the repository.
In gitlab go to

profile settings -> SSH Keys

and add the key

查看更多
狗以群分
3楼-- · 2019-03-08 22:53

The rsa.pub (i.e. public key generated), needs to be added on the github>> settings>>ssh keys page. Check that, you have not added this public key in the repository-settings >> deployment keys. If so, remove the entry from here and add to the first place mentioned.

Setup of the pub-private keys in detail.

It will work hence!

查看更多
Rolldiameter
4楼-- · 2019-03-08 22:54

Strangely I only received this error in 1 of my many repos.

My issue was after installing the new GitHub Desktop for Windows where the previous old GitHub for Win kept keys in ~/.ssh/github_rsa and ~/.ssh/github_rsa.pub where as the new GitHub for Win expects it in ~/.ssh/id_rsa so the solution was just renaming the existing private and public keys:

~/.ssh/github_rsa -> ~/.ssh/id_rsa
~/.ssh/github_rsa.pub -> ~/.ssh/id_rsa.pub

After which let me access the repo again without issue.

查看更多
Ridiculous、
5楼-- · 2019-03-08 22:55

Try to use HTTPS instead SSH with taking close url from GIT, it work for me. and then take from of that url, by gitbase or any other git client. enter image description here

查看更多
我只想做你的唯一
6楼-- · 2019-03-08 22:55

add these lines to your .get/config file (thanks to @kovshenin answer Git Pull: Change Authentication) :

[credential]
    helper = wincred
查看更多
欢心
7楼-- · 2019-03-08 22:55

Try https instead of ssh. Choose the https option from project home page where you copy the clone url from.

查看更多
登录 后发表回答