1

i had a repository cloned and that worked very well. Unfortunatelly i had a problem with files inside so i decided to start from new. I deleted the repo on github and the folder on my computer.

After that i created the repo again and tried to clone it back to PC i get this error all the time.

git.exe clone --progress -v "[email protected]:USER/REPOSITORY.git" "E:\FOLDERNAME"
Cloning into 'E:\FOLDERNAME'...
[email protected]: Permission denied (publickey).
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) (672 ms @ 03.10.2021 01:07:48)

I tried so much to solve the issue:

  • regenerate new SSH-Key(s) and stored it on github
  • create another repo with a different name
  • reinstalled tortoise git
  • Also tried to find a index.lock (cant find)
  • reconfigured Name and E-mail (also with git bash)(does these infos has to be the same than on github account?)

Its strange but allthough i reinstalled tortoise git completely new, he still displayed the correct SSH-Key path but its greyed out so also if i would like to change that i cant.

Tried all solutions from: How to resolve "git did not exit cleanly (exit code 128)" error on TortoiseGit?

2 Answers 2

1

Try first to clone it directly from command-line:

git -c "core.sshcommand='ssh -Tv'" clone --progress -v "[email protected]:USER/REPOSITORY.git" "E:\FOLDERNAME"

The core.sshcommand='ssh -Tv' will tell you if you are reading the correct SSH key.

Check you don't have any SSH_xxx or GIT_SSHxxx environment variable.

Once the clone is working from command-line, you can start and try it through TortoiseGit.

Sign up to request clarification or add additional context in comments.

3 Comments

Thank you for the answer. No environment variable setted. $ git -c "core.sshcommand='ssh -Tv'" clone --progress -v "[email protected]:USER/REPOSITORY.git" "E:\FOLDERNAME" Cloning into 'E:\FOLDERNAME'... 'ssh -Tv': ssh -Tv: command not found fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.
TortoiseGit -> Show Environment Variables shows a file (PatB03E.tmp) which contains Variables but i was not able to find them over wondows settings. GIT_SSH=C:\Program Files\Git\usr\bin\ssh.exe SVN_SSH=C:\Program Files\Git\usr\bin\ssh.exe DISPLAY=:9999 SSH_ASKPASS=C:\Program Files\TortoiseGit\bin\SshAskPass.exe GIT_ASKPASS=C:\Program Files\TortoiseGit\bin\SshAskPass.exe GIT_ASK_YESNO=C:\Program Files\TortoiseGit\bin\SshAskPass.exe
@C.Hillert Yes, never use putty or Tortoise SSH. Always use the openSSH one coming with Git For Windows.
1

Found the solution. Because of some troubleshooting solutions i changed the SSH-Client at TortoiseGit > Settings > Network from ssh.exe to the same that git uses. Because of that the field for the Private Key Path in TortoiseGit cloning window was greyed out. I entered now the TortoiseGitPlink.exe so the field was released, now i was able to set the new private key path.

Unfortunatelly now i got the error No supported authentication methods available (Sever sent: public key). So i changed the SSH-Client back to ssh.exe (without direct path) and now it worked fine!

I really dont know what exatly was wrong but it works now so im happy.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.