Git error: "Please make sure you have the correct access rights and the repository exists"
Git error: "Please make sure you have the correct access rights and the repository exists"
Question
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 "[email protected]:\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 ?
Popular Answer
Your git URL might have changed. Change the URL in the local directory by using the following command
git remote set-url origin [email protected]
Read more... Read less...
That problem might be having with your ssh-agent, your ssh key hasn't been added with ssh-agent.You have to apply following steps using your terminal:-
$ eval "$(ssh-agent -s)"
Agent pid 5867
$ ssh-add
Enter passphrase for /home/you/.ssh/id_rsa: [] Identity added: /home/you/.ssh/id_rsa (/home/you/.ssh/id_rsa)
then it will work..cheers J.
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
Github now uses a url scheme
git remote set-url origin https://github.com/username/repository.git
You are trying to clone the repository over ssh: [email protected]
, and your SSH keys are not properly set on server. There are multiple reasons to this:
- Your public key might not be saved in authorized_keys file of user git
- If 1 is not true the Your private key is not saved in .ssh/ folder of your HOMEDIR.
- Permissions are not properly set
If all 3 above are untrue then my only conclusion can be to try:
[email protected]:AlfaRobot.git
Assuming AlfaRobot.git is in HOMEDIR of git user and not inside a folder called git which resides in HOMEDIR of user git.