TortoiseGit trouble: git did not exit cleanly (exit code 128)
Asked Answered
L

5

8

Here is a little bit background:

  1. I run Win7
  2. I have private git repo and installed Github for Windows
  3. I didn't like the Github for Windows client (lack capabilities). I installed TortoiseGit for Windows (still keep Github for Windows)
  4. I followed steps here exactly http://dancingmonkeysaccelerated.blogspot.com/2012/03/git-for-windows-with-tortoisegit-and.html
  5. I can get log and commit local

enter image description here

  1. Then I Push

enter image description here

  1. However it gave error git did not exit cleanly (exit code 128)

enter image description here

I read this thread:

How to resolve "git did not exit cleanly (exit code 128)" error on TortoiseGit?

And actually changed SSH key by running Puttygen THREE TIMES already. I also set Full Permission for Users in the folder. Nothing works!!

Here is what I see in Environment Path

PATH=(others);C:\Users\myusername\AppData\Local\GitHub\PortableGit_93e8418133eb85e81a81e5e19c272776524496c6\libexec\git-core;

GIT_SSH=C:\Program Files\TortoiseGit\bin\TortoiseGitPLink.exe

SVN_SSH=C:\Program Files\TortoiseGit\bin\TortoiseGitPLink.exe

SSH_ASKPASS=C:\Program Files\TortoiseGit\bin\SshAskPass.exe

GIT_ASKPASS=C:\Program Files\TortoiseGit\bin\SshAskPass.exe

However: if I use Github for Windows it works fine.

Can someone point me to a direction to troubleshoot this TortoiseGit issue?

Lp answered 13/2, 2013 at 7:11 Comment(7)
Does TortoiseGit -> Settings -> Environment variables shows you the environment variable HOME set? And if yes, is it to a path where you can see %HOME%/.ssh/id_rsa(.pub) files?Mascara
Could you check in your .git folder if there is an ´index_lock` file (or another file named lock? If so, delete it and try again.Demilune
@Mascara I updated the question. Should I enter %HOME%/.ssh/id_rsa(.pub) exactly as-is? I don't see such folder .ssh anywhere. @Sgoettschekes There is no index_lock or any lock file. What's next?Lp
HOME should point to a directory in which you see .ssh/id_rsa and .ssh/id_rsa.pub: so the value you need to enter is not %HOME%/.ssh/id_rsa(.pub), but a directory (like %USERPROFILE% or any other directory where Puttygen did generate those keys)Mascara
I guess I was a bit confused because there was no .pub file created by Puttygen. It was .ppk file. So I put it here c:\TortoiseGit.ppk and even when I have `c:` in the path, it still doesn't work :(Lp
Any help please or should I use a different tool beside TortoiseGit?Lp
Are you using TortoiseGit 1.8.0? Upgrade to TortoiseGit 1.8.1 and see if problem solved?Coliseum
L
0

I think I found a better alternative for Windows: http://www.syntevo.com/smartgithg/index.html

It's been working so far. But I still prefer TortoiseGit if I can get it to work.

Lp answered 19/2, 2013 at 8:48 Comment(2)
I also tried TortoiseGit at some point (especially after using Tortoise-SVN for years), but I found it .. low quality and somewhat unintuitive. Currently, on Windows, I use, and I recommend everyone, the Git Extensions package. It comes with: Git client, Cheetah, and even Git bash (with minimal Linux utils built for Win). Installs cleanly out-of-box. Git-Cheetach attaches to Explorer just like TortoiseXXX do, and is tailored to Git commands. Of course, that's just my preference, so I drop a comment, not answer, since the questions stays unsolved.Ranunculaceous
I just posted a new answer which should clearify differences between openssh and putty: https://mcmap.net/q/372602/-tortoisegit-trouble-git-did-not-exit-cleanly-exit-code-128Myrnamyrobalan
M
2

Generic answer

Every time git.exe is executed it returns an exit code (cf. Does git return specific return error codes?).

An exit code of 0 indicates success.

In the StackOverflow post the exit code 128 is mentioned, which indicates an error:

The (exit code 128) is some kind of "unexpected error" (cf. https://mcmap.net/q/203296/-does-git-return-specific-return-error-codes). What it means is highly dependant on the git command executed and the output it issued. Therefore, there can't be a single easy and short answer on how to solve this.

The following post contains a specific answer which is related to the push case and at the end a more generic answer (If this doesn't help section).


Answer for the case of the initial Stackoverflow post

The following answer is based on the fact, that git.exe was executed to run a push.

Using TortoiseGit with SSH

Here one needs to differentiate between OpenSSH and PuTTY. (See here)

OpenSSH

In order to use OpenSSH you have to set ssh.exe as "SSH client" on TortoiseGit settings -> Network.
OpenSSH uses %HOME%/.ssh/id_rsa(.pub) files for their public/private keys by default, which must be created by OpenSSH ssh-keygen and not PuTTYGen (PuTTY keys have a different format, however, can also be converted using PuTTYGen).
If %HOME% is not set, TortoiseGit will set it automatically, if you manually set %HOME% please make sure it is valid (you might have to use slashes instead of backslashes).

This is recommended for people who already have their OpenSSH keys.

PuTTY

PuTTY, which is to be preferred on Windows, requires that public/private keys are created using PuTTYGen (which is shipped with TortoiseGit).
TortoiseGitPlink.exe needs to be selected as ssh client on TortoiseGit settings -> Network - that should be the default. However, there is no default place for the public/private keys and, thus, these have to be configured. There are (at least two ways to do that):

  1. Configure your key to be the default key in PuTTY based applications. For this, open PuTTY (which is not shipped with TortoiseGit and has to be downloaded separately). Then go to the Connection-> SSH -> Auth configuration page and select your .ppk file as "Private key for authentication", go back to the "Session" configuration page, select "Default Settings" there and hit save. -> From now on PuTTY and PLink will use this key for authentication.

  2. In order to make TortoiseGit load a private key for using with PuTTY one has to configure it.

    • For an existing repository: Choose a repository, open TortoiseGit settings -> Remote and select your remote repository configuration there (normally "origin"). Then select your private .ppk key and hit "Add new/Save".
    • For a new repository the key can be selected while cloning. When pushing/pulling make sure "Autoload putty key" is checked.

More tips/tricks for using PuTTY.


If this doesn't help

First of all we need to make sure that the right git.exe is called - normally that should be the case as TortoiseGit tries hard to find the correct git.exe on the system on first start-up. This can be easily done by going to the TortoiseGit settings -> General. There one should check whether "git.exe Path" points to the right folder of "Git for Windows" (in must point to the bin folder of the Git for Windows installation, not the cmd folder - but this should happen automatically) - if msysgit (the development version of "Git for Windows") is used, it is necessary that the [MSYSGIT-INSTALL-PATH]\mingw\bin-folder is on the path (i.e. entered in the Extern DLL Path textbox) in order to execute git.exe (otherwise required .dll-files) cannot be found. (See TortoiseGit docs)

Now click on "Check now" and check that the right version number appears next to the button (not no error message).
If this is working, git.exe should be configured correctly and work with https.

Myrnamyrobalan answered 29/9, 2014 at 13:13 Comment(0)
P
1

I was having this same issue and I resolved it in the following way...

I have the NVIDIA "Tegra Android Development Pack" installed and it seems to also have a version of mysysgit.exe with it. TortoiseGit automatically found that installation location (instead of the standard git installation) and auto-populated it in the settings menu.

To correct this, go to: "Settings -> General" and there is a field for the path to mysysgit.exe. Make sure this is pointing to the correct installation.

Pooka answered 5/9, 2013 at 14:17 Comment(0)
L
0

I think I found a better alternative for Windows: http://www.syntevo.com/smartgithg/index.html

It's been working so far. But I still prefer TortoiseGit if I can get it to work.

Lp answered 19/2, 2013 at 8:48 Comment(2)
I also tried TortoiseGit at some point (especially after using Tortoise-SVN for years), but I found it .. low quality and somewhat unintuitive. Currently, on Windows, I use, and I recommend everyone, the Git Extensions package. It comes with: Git client, Cheetah, and even Git bash (with minimal Linux utils built for Win). Installs cleanly out-of-box. Git-Cheetach attaches to Explorer just like TortoiseXXX do, and is tailored to Git commands. Of course, that's just my preference, so I drop a comment, not answer, since the questions stays unsolved.Ranunculaceous
I just posted a new answer which should clearify differences between openssh and putty: https://mcmap.net/q/372602/-tortoisegit-trouble-git-did-not-exit-cleanly-exit-code-128Myrnamyrobalan
I
0

In my case, I made that commit (victim of did-not-exit-cleanly) from Git Bash. And tried the next commit from Tortoise, which worked!

Iaverne answered 30/6, 2018 at 11:14 Comment(0)
K
0

I couldn't clone the git repo into my local folder, bellow is the command that fixed it

git config --global http.sslverify false

Kyles answered 26/7, 2021 at 20:56 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.