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

18

130

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?

Yu answered 8/3, 2012 at 12:1 Comment(10)
Is that the only error you're getting? Usually you see this error with other error messages. It could mean so many things, from local configuration problems to server configs.Textualist
low disk space caused this issue to meTumbling
for me it was not working with tortoise git, but i got success with git bash simply. Try thatDavid
I voted to reopen. There might be many answers possible for this question, but from a user point of view, there is nothing more that can be provided as the OP has done. The range of possible answers does not stem from what the OP is asking but how the return code 128 is used by git.Sphygmoid
In my case, I just type ssh-add in the terminal and start works.Grapheme
In my case changing config source from global to system helped.Malina
I know this is quite old, but i had the case with all remote opeartions via https. I figured out that i needed to rename libeay32.dll for testing a software project and forgot to revert that change. So if you have .dll errors/missing for the encryption part, you may also get this error without any further information.Tombola
In my case, the destination path where the project is cloning is "long". I tried changing the destination path to a smaller path in length, It works. Sometimes the error is not able to create the file in our local machine due to the destination path length is too long, try changing it to simple path.Plexiform
the problem on my end, the paths were too long. Once they were shortened, it worked.Sanction
other reason could be the name of repository doesn`t exist anymoreDorweiler
V
55

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

Voss answered 2/4, 2012 at 16:50 Comment(4)
It doesn't mean the key was compromised ... github invalidated all keys when they were hacked a few weeks ago.Yu
For creating new SSH key. Refer to help.github.com/articles/generating-ssh-keysRemanence
FYI, this answer is no longer valid, because exit code 128 can mean a lot of things, and isn't specific to SSH.Eyewitness
@Eyewitness I agree with you! exit code 128 means a lot of things. In my case, the destination path where the project is cloning is "long". I tried changing the destination path to a smaller path in length, It works. Sometime the error is not able to create the file in our local machine due to the destination path length is too long.Plexiform
D
45

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"
Daggna answered 21/6, 2013 at 5:38 Comment(4)
This is for the unix-based systems. The guys is asking for Windows. In Ubuntu we all know it's easy as pie ...Berkelium
The above obviously works on windows as well. As far as I know git commands are never os specific.Inkhorn
Thanks that solved my problem Bitbucket. Had to add a name and mail to the Tortoise settings and now it works!Anchusin
solved my problem on WindowsDiverticulosis
H
12

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.

Hop answered 9/3, 2012 at 15:58 Comment(1)
it worked, i am using windows 10.Cobaltite
B
11

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

Deleting index.lock makes the error go away.

Burlingame answered 25/1, 2013 at 18:22 Comment(1)
This worked for me after I aborted a commit after realizing I'd missed a file. Deleting it allowed me to commit and push again.Abysm
D
7

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

Determinable answered 23/10, 2012 at 12:48 Comment(1)
Go into your cmd and run this : git config --global http.sslverify falseExhale
F
6

Deleting index.lock worked for me

Fabrianne answered 22/11, 2013 at 18:34 Comment(1)
I faced the exact same problem using Source Tree and this solution fits me best! Thank you!Drumm
F
4

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.

Fordone answered 6/1, 2013 at 12:10 Comment(0)
C
3

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.

Collenecollet answered 12/11, 2013 at 15:13 Comment(0)
H
1

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)

Howerton answered 2/12, 2012 at 7:32 Comment(0)
P
1

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

Perigee answered 20/3, 2013 at 13:45 Comment(0)
E
1

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.

Encephalic answered 22/4, 2013 at 21:37 Comment(0)
Y
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.

Yellowtail answered 5/9, 2013 at 14:18 Comment(0)
B
1

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

Basidiospore answered 7/1, 2014 at 8:26 Comment(0)
S
1

I reconfigured the Git port to solve the problem because using VPN caused a discrepancy between Git and the local port.

Sorrells answered 16/1 at 16:23 Comment(0)
A
0

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.

Agility answered 15/8, 2013 at 9:54 Comment(0)
R
0

although, it is a very old thread, recently I got this error, and in my case, the link was broken. When the link to GitHub was fixed, it worked.

Rigsby answered 8/12, 2022 at 1:30 Comment(1)
Please don't add "thank you" as an answer. Instead, vote up the answers that you find helpful. - From ReviewJochbed
P
0

What has worked for me: Removing all offending branch related files from all folders in .git\ref and .git\logs

Planking answered 20/1, 2023 at 13:8 Comment(0)
S
0

I got this error while trying to pull/fetch code from Bitbucket repo because my internet connection was not working.

Make sure your internet connection is working properly
Seducer answered 21/4, 2023 at 10:55 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.