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

GitTortoisegit

Git Problem Overview


I've run into this serious error while committing, and created a bug report.

I keep getting this error on TortoiseGit operations:

> git did not exit cleanly (exit code 128)

I've reinstalled the program, rebooted, and tried to clone a fresh repo from github - nothing seems to work. I also deleted %appdata%\Tortoise git folder ... I'm at a loss now. Any advice on how to proceed?

Git Solutions


Solution 1 - Git

It's probably because your SSH key has been removed/revoked. Make a new one and add it to your GitHub account.

Solution 2 - Git

for me I simply had to add configure my git username and email with the following commands:

git config --global user.email "[email protected]"
git config --global user.name "Your Name"

Solution 3 - Git

If you're running windows 7:

I was trying to decide the best way to do this securely, but the lazy way is :

  1. right-click the parent folder
  2. click the "properties" button
  3. click the "security" tab
  4. click the "edit" button
  5. click the group that starts with "Users"
  6. click the checkbox that says "full control"
  7. click all the OK's to close the dialogs.

I realize this might circumvent windows "security" features, but it gets the job done.

Solution 4 - Git

git-bash reports fatal: Unable to create <Path to git repo>/.git/index.lock: File exists.

Deleting index.lock makes the error go away.

Solution 5 - Git

In my case a folder in my directory named as the git-repository on the server caused the failure.

Solution 6 - Git

Deleting index.lock worked for me

Solution 7 - Git

on win7 64:

git-gui gives a good answer: a previous git has crashed and left a lock file. Manually remove. In my case, this was in .git/ref/heads/branchname.lock.

delete, and error 128 goes away. It surprises that tortoisegit doesn't give such an easy explanation.

Solution 8 - Git

In my case, it was because of the proxy. A proxy was needed in the corporate network and TortoiseGit / Git does not seems to automatically get information from Windows internet settings. Setting up the proxy address solved the issue.

Solution 9 - Git

For me, I tried to check out a SVN-project with TortoiseGit. It worked fine if I used TortoiseSVN though. (May seem obvious, but newcomers may stumble on this one)

Solution 10 - Git

In my case, I forgot to add git to the respository name at the end.

Solution 11 - Git

I did git revert a multiple times ,and it worked for me make sure un-check the files while reverting you need changes. Stash your changes and pull again.

Solution 12 - Git

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.

Solution 13 - Git

An quick solution would be to create a new local directory for example c:\git_2014, In this directory rightklick and choose Git Clone

Solution 14 - Git

make sure the username and email fields are not empty in the config file. and try to clone to an empty directory. these steps worked for me.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionripper234View Question on Stackoverflow
Solution 1 - GitgazView Answer on Stackoverflow
Solution 2 - GitBenjamin KaiserView Answer on Stackoverflow
Solution 3 - Gituser416456View Answer on Stackoverflow
Solution 4 - GitdezirusView Answer on Stackoverflow
Solution 5 - GitBennyView Answer on Stackoverflow
Solution 6 - GitSirentecView Answer on Stackoverflow
Solution 7 - GitoptoView Answer on Stackoverflow
Solution 8 - GitCesarView Answer on Stackoverflow
Solution 9 - GitErik BergstedtView Answer on Stackoverflow
Solution 10 - GitManasi DiwanView Answer on Stackoverflow
Solution 11 - Gituser2062360View Answer on Stackoverflow
Solution 12 - GitroadrunnerView Answer on Stackoverflow
Solution 13 - GitRoel van RoozendaalView Answer on Stackoverflow
Solution 14 - Gitsajin tmView Answer on Stackoverflow