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?
MrTux
32.1k30 gold badges108 silver badges146 bronze badges
asked Mar 8, 2012 at 12:01
ripper234ripper234
221k273 gold badges629 silver badges902 bronze badges
10
It’s probably because your SSH key has been removed/revoked. Make a new one and add it to your GitHub account.
dimo414
46.8k18 gold badges146 silver badges238 bronze badges
answered Apr 2, 2012 at 16:50
4
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"
answered Jun 21, 2013 at 5:38
4
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.
Alicia
1,1521 gold badge23 silver badges41 bronze badges
answered Mar 9, 2012 at 15:58
1
git-bash
reports
fatal: Unable to create <Path to git repo>/.git/index.lock
: File exists.
Deleting index.lock
makes the error go away.
sandip
5439 silver badges27 bronze badges
answered Jan 25, 2013 at 18:22
dezirusdezirus
1191 silver badge2 bronze badges
1
In my case a folder in my directory named as the git-repository on the server caused the failure.
answered Oct 23, 2012 at 12:48
BennyBenny
1091 silver badge6 bronze badges
1
Deleting index.lock worked for me
answered Nov 22, 2013 at 18:34
m0r6aNm0r6aN
84011 silver badges19 bronze badges
1
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.
answered Jan 6, 2013 at 12:10
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.
answered Nov 12, 2013 at 15:13
CesarCesar
2,05925 silver badges30 bronze badges
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)
answered Dec 2, 2012 at 7:32
In my case, I forgot to add git to the respository name at the end.
answered Mar 20, 2013 at 13:45
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.
answered Apr 22, 2013 at 21:37
user2062360user2062360
1,2635 gold badges16 silver badges28 bronze badges
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.
answered Sep 5, 2013 at 14:18
An quick solution would be to create a new local directory for example c:git_2014, In this directory rightklick and choose Git Clone
answered Jan 7, 2014 at 8:26
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.
answered Aug 15, 2013 at 9:54
sajin tmsajin tm
3233 silver badges8 bronze badges
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.
answered Dec 8, 2022 at 1:30
uSeruSer
236 bronze badges
1
What has worked for me:
Removing all offending branch related files from all folders in .gitref and .gitlogs
answered Jan 20 at 13:08
fatherOfWinefatherOfWine
1,17116 silver badges38 bronze badges
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
answered Apr 21 at 10:55
Suban DhyakoSuban Dhyako
2,3864 gold badges16 silver badges38 bronze badges
Asked
9 years, 11 months ago
Viewed
47k times
What is git-remote-http error code 128. It happened when I tried to pust to a repo that needed authentication (it never asked for a password.) Is there some central place to find out what error codes mean?
asked Jun 21, 2013 at 21:38
3
128
is a default fatal error code. It doesn’t mean it’s necessarily something to do with authentication.
That means you have to read the error message.
See the source code, and git documentation.
answered Oct 19, 2021 at 13:30
StefanoStefano
1,6461 gold badge16 silver badges25 bronze badges
If you talk of the command return code, it means that the key has been revoked.
You can find the existing codes here for example: http://mazack.org/unix/errno.php
answered Mar 28, 2019 at 15:36
padawinpadawin
4,17214 silver badges19 bronze badges
1
it’s probably because your SSH key has been compromised. Make a new one and add it to your GitHub account.
answered May 2, 2014 at 14:30
0
The ‘Did Not Exit Cleanly Exit Code 128’ error is a common issue that developers may face when working with Git. This error occurs when Git encounters a problem while executing an operation, resulting in an unexpected exit. In this guide, we’ll walk you through the possible reasons for this error and provide step-by-step solutions to resolve it.
Table of Contents
- Possible Causes of the Error
- Step-by-Step Solutions
- 1. Check for Permission Issues
- 2. Resolve Merge Conflicts
- 3. Verify Git Installation
- 4. Update or Reinstall Git
- 5. Check for Disk Space Issues
- FAQs
Possible Causes of the Error
Before diving into the solutions, it’s essential to understand the possible reasons behind the ‘Did Not Exit Cleanly Exit Code 128’ error. Some common causes include:
- Permission issues with the repository or its files.
- Merge conflicts that prevent Git from performing its operations.
- Corrupted or incomplete Git installation.
- Outdated Git version.
- Insufficient disk space.
Step-by-Step Solutions
1. Check for Permission Issues
The first step to resolve the error is to check if there are any permission issues with your repository or its files. Make sure you have the necessary access rights to perform the desired Git operation. You can use the following command to check the permissions of your repository’s files:
ls -la
If you find that you don’t have the required permissions, you can either contact your repository administrator to grant you access or change the permissions using the chmod
command. For example, to grant read, write, and execute permissions to the owner, group, and others for a file named «example.txt», you can use the following command:
chmod 777 example.txt
2. Resolve Merge Conflicts
If you encounter the error during a merge operation, it’s possible that there are merge conflicts that need to be resolved. To fix the conflicts, follow these steps:
Identify the conflicting files by running the following command:
git status
Open each conflicting file and resolve the conflicts by choosing the desired changes or manually merging the code.
After resolving the conflicts, stage the changes using the following command:
git add <file>
Finally, commit the changes using the following command:
git commit -m "Resolved merge conflicts"
3. Verify Git Installation
If the error persists, it’s possible that your Git installation is corrupted or incomplete. To verify the installation, run the following command:
git --version
If the command returns an error or doesn’t display the Git version, it’s likely that your Git installation is faulty.
4. Update or Reinstall Git
To fix a corrupted or outdated Git installation, you can either update Git to the latest version or reinstall it. Follow the instructions for your operating system:
- Update Git on Windows
- Update Git on macOS
- Update Git on Linux
If updating doesn’t resolve the issue, consider uninstalling Git and reinstalling it using the links above.
5. Check for Disk Space Issues
Lastly, make sure you have sufficient disk space available to perform the Git operation. If your disk is running out of space, delete unnecessary files or move them to another location to free up space.
FAQs
Q1: What does exit code 128 mean in Git?
Exit code 128 is a generic error code that indicates that Git encountered a problem while executing an operation, resulting in an unexpected exit. This error can be caused by various reasons, such as permission issues, merge conflicts, or a corrupted Git installation.
Q2: How do I resolve a Git error?
To resolve a Git error, first identify the cause of the error by examining the error message and the context in which the error occurred. Then, follow the appropriate steps to address the issue, such as resolving merge conflicts, checking permissions, or updating Git.
Q3: How do I check if Git is installed correctly?
To check if Git is installed correctly, open a terminal or command prompt and run the following command:
git --version
If the command returns the Git version, it’s likely that Git is installed correctly. If the command returns an error or doesn’t display the Git version, your Git installation may be faulty.
Q4: How do I update Git to the latest version?
To update Git to the latest version, follow the instructions for your operating system:
- Update Git on Windows
- Update Git on macOS
- Update Git on Linux
Q5: How much disk space does Git require?
The disk space required for Git depends on the size of your repository and its history. However, it’s generally recommended to have at least a few gigabytes of free disk space available for Git operations.
Git documentation | Git merge conflicts | Update Git on Windows | Update Git on macOS | Update Git on Linux
Git is a powerful version control system used by software developers to manage their codebase.
TortoiseGit is a popular GUI client for Git that makes it easy to use Git on Windows.
However, sometimes TortoiseGit users may encounter the error “Git did not exit cleanly (exit code 128)” when trying to commit or push changes to their repository.
This error can be frustrating, but it is usually easy to fix.
Table of Contents
What Causes the Git Did Not Exit Cleanly Exit Code 128 Error?
This error usually occurs when TortoiseGit encounters an issue while trying to access the Git index.
The Git index is a binary file that tracks changes to the repository.
When TortoiseGit is unable to access the index, it displays the error “Git did not exit cleanly (exit code 128)”.
The most common causes of this error include:
- A corrupted Git index
- An unfinished merge operation
- A conflict between the local repository and the remote repository
- A Git lock file that is not released
There are several solutions to this problem, depending on the cause of the error.
Here are some steps to try:
Remove the corrupted Git index
If the Git index is corrupted, you can remove it and then run the “git reset” command to recreate it.
To do this, follow these steps:
- Open the Git repository in Windows Explorer
- Go to the “.git” folder and delete the “index” file
- Open the Git Bash or Command Prompt and navigate to the repository
- Run the following command:
git reset
Finish the merge operation
If you were in the middle of a merge operation when the error occurred, you can finish the merge by running the “git merge –abort” command.
git merge --abort
Resolve the conflict between the local and remote repository
If there is a conflict between the local repository and the remote repository, you will need to resolve the conflict before you can commit and push your changes.
To do this, follow these steps:
- Pull the latest changes from the remote repository
- Open the files that have conflicts and resolve them
- Commit the resolved conflicts
- Push the changes to the remote repository
Release the Git lock file
If the Git lock file is not released, you can remove it manually to resolve the error.
To do this, follow these steps:
- Open the Git repository in Windows Explorer
- Go to the “.git” folder and delete the “index.lock” file
Conclusion
The “Git did not exit cleanly (exit code 128)” error can be frustrating, but it is usually easy to resolve.
By trying the solutions listed above, you should be able to get TortoiseGit working again.
If you continue to have issues, you can always consult the TortoiseGit documentation or reach out to the TortoiseGit community for help.
Пытаюсь создать GIT через BitBucket но столкнулся с ошибкой. Делаю все так же как и написано тут — habrahabr.ru/sandbox/37865
Но на шаге когда пытаюсь сделать Git Clone и ввожу данные возникает данная ошибка.
Публичный ключ на битбукет загружен. Может быть в Git на машине нужно где-то логин и пароль ввести от bitbucket?
Помогите решить пожалуйста.
-
Вопрос заданболее трёх лет назад
-
23279 просмотров
Авторизация на bitbucket осуществляется по ключу, поэтому логин и пароль нигде вводить не нужно.
Вероятно проблема в ключе. Проверьте его регистрацию на bitbucket и доступ TortoiseGit к файлу закрытого ключа.
Еще можно попробовать настроить консольный Git на использование вашего ключа.
Для этого в директории пользователя C:Users[Логин] создайте папку .ssh и положите в нее файл закрытого ключа в текстовом формате OpenSSH дав ему имя id_rsa. Конвертировать ключ из формата Putty в формат OpenSSH можно с помощью утилиты из состава Putty.
После этого попробуйте клонировать репозиторий командой git clone -vvv [URL репозитория]
Ключ -vvv выдаст подробную диагностику процесса.
Пригласить эксперта
-
Показать ещё
Загружается…
04 июн. 2023, в 01:35
1500 руб./за проект
04 июн. 2023, в 01:25
40000 руб./за проект
03 июн. 2023, в 23:42
1500 руб./за проект