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 "git@github.com:USER/REPOSITORY.git" "E:\FOLDERNAME"
Cloning into 'E:\FOLDERNAME'...
git@github.com: 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?

C.Hillert
  • 113
  • 1
  • 8

2 Answers2

1

Try first to clone it directly from command-line:

git -c "core.sshcommand='ssh -Tv'" clone --progress -v "git@github.com: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.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thank you for the answer. No environment variable setted. $ git -c "core.sshcommand='ssh -Tv'" clone --progress -v "git@github.com: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. – C.Hillert Oct 03 '21 at 00:26
  • 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 Oct 03 '21 at 00:40
  • @C.Hillert Yes, never use putty or Tortoise SSH. Always use the openSSH one coming with Git For Windows. – VonC Oct 03 '21 at 01:36
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.

C.Hillert
  • 113
  • 1
  • 8