Home > Software engineering >  GitHub & Tortoisegit: git did not exit cleanly (exit code 128)
GitHub & Tortoisegit: git did not exit cleanly (exit code 128)

Time:10-03

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?

CodePudding user response:

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.

CodePudding user response:

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.

  • Related