如何解决 TortoiseGit 上的“git 没有完全退出(退出代码 128)”错误?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9617336/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to resolve "git did not exit cleanly (exit code 128)" error on TortoiseGit?
提问by ripper234
I've run into this serious error while committing, and created a bug report.
我在提交时遇到了这个严重的错误,并创建了一个错误报告。
I keep getting this error on TortoiseGit operations:
我在 TortoiseGit 操作中不断收到此错误:
git did not exit cleanly (exit code 128)
git 没有完全退出(退出代码 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?
我重新安装了程序,重新启动,并尝试从 github 克隆一个新的存储库 - 似乎没有任何效果。我还删除了 %appdata%\Tortoise git 文件夹......我现在不知所措。有关如何进行的任何建议?
采纳答案by gaz
It's probably because your SSH key has been compromised. Make a new one and add it to your GitHub account.
这可能是因为您的 SSH 密钥已被泄露。创建一个新的并将其添加到您的 GitHub 帐户。
回答by Benjamin Kaiser
for me I simply had to add configure my git username and email with the following commands:
对我来说,我只需要使用以下命令添加配置我的 git 用户名和电子邮件:
git config --global user.email "[email protected]"
git config --global user.name "Your Name"
回答by dezirus
git-bash
reports
fatal: Unable to create <Path to git repo>/.git/index.lock
: File exists.
git-bash
报告致命:无法创建<Path to git repo>/.git/index.lock
:文件存在。
Deletingindex.lock
makes the error go away.
删除index.lock
会使错误消失。
回答by user416456
If you're running windows 7:
如果您运行的是 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.
我意识到这可能会绕过 Windows 的“安全”功能,但它可以完成工作。
回答by Benny
In my case a folder in my directory named as the git-repository on the server caused the failure.
在我的情况下,我的目录中名为服务器上的 git-repository 的文件夹导致了失败。
回答by opto
on win7 64:
在 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.
git-gui 给出了一个很好的答案:以前的 git 已经崩溃并留下了一个锁定文件。手动删除。就我而言,这是在 .git/ref/heads/branchname.lock 中。
delete, and error 128 goes away. It surprises that tortoisegit doesn't give such an easy explanation.
删除,错误 128 消失。令人惊讶的是,tortoisegit 并没有给出如此简单的解释。
回答by Sirentec
Deleting index.lock worked for me
删除 index.lock 对我有用
回答by Cesar
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.
就我而言,这是因为代理。公司网络中需要代理,而 TortoiseGit / Git 似乎不会自动从 Windows 互联网设置中获取信息。设置代理地址解决了这个问题。
回答by Roel van Roozendaal
An quick solution would be to create a new local directory for example c:\git_2014, In this directory rightklick and choose Git Clone
一个快速的解决方案是创建一个新的本地目录,例如 c:\git_2014,在这个目录中右键单击并选择 Git Clone
回答by roadrunner
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.
我安装了 NVIDIA“Tegra Android Development Pack”,它似乎也有一个 mysysgit.exe 版本。TortoiseGit 自动找到安装位置(而不是标准的 git 安装)并在设置菜单中自动填充它。
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.
要更正此问题,请转至:“设置 -> 常规”,其中有一个用于输入 mysysgit.exe 路径的字段。确保这指向正确的安装。