Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

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?

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. SinisterRainbow Mar 10, 2012 at 16:02 for me it was not working with tortoise git, but i got success with git bash simply. Try that Noman Oct 27, 2014 at 19:52 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. SpaceTrucker Mar 30, 2015 at 9:56 It doesn't mean the key was compromised ... github invalidated all keys when they were hacked a few weeks ago. ripper234 Apr 2, 2012 at 16:54 FYI, this answer is no longer valid, because exit code 128 can mean a lot of things, and isn't specific to SSH. jefflunt Jul 12, 2019 at 3:24 @jefflunt 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. Bala Subramanyam Nov 3, 2021 at 15:17

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

git config --global user.email "you@example.com"
git config --global user.name "Your Name"
                This is for the unix-based systems. The guys is asking for Windows. In Ubuntu we all know it's easy as pie ...
– Деян Добромиров
                Jun 27, 2016 at 8:29
                The above obviously works on windows as well. As far as I know git commands are never os specific.
– T_D
                Sep 19, 2016 at 15:30
                Thanks that solved my problem Bitbucket. Had to add a name and mail to the Tortoise settings and now it works!
– Johannes Stadler
                Mar 6, 2018 at 14:09

If you're running windows 7:

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

  • right-click the parent folder
  • click the "properties" button
  • click the "security" tab
  • click the "edit" button
  • click the group that starts with "Users"
  • click the checkbox that says "full control"
  • click all the OK's to close the dialogs.
  • I realize this might circumvent windows "security" features, but it gets the job done.

    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. – Robert Went Nov 20, 2016 at 17:36 I faced the exact same problem using Source Tree and this solution fits me best! Thank you! – Paulo Henrique Queiroz Feb 2, 2017 at 13:08

    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.

    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.

    Please don't add "thank you" as an answer. Instead, vote up the answers that you find helpful. - From Review – Simas Joneliunas Dec 14, 2022 at 1:13

    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
            

    Thanks for contributing an answer to Stack Overflow!

    • Please be sure to answer the question. Provide details and share your research!

    But avoid

    • Asking for help, clarification, or responding to other answers.
    • Making statements based on opinion; back them up with references or personal experience.

    To learn more, see our tips on writing great answers.