TortoiseGit 问题:git 没有干净地退出(退出代码 128)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/14848263/
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
TortoiseGit trouble: git did not exit cleanly (exit code 128)
提问by HP.
Here is a little bit background:
这里有一点背景:
- I run Win7
- I have private git repo and installed Github for Windows
- I didn't like the Github for Windows client (lack capabilities). I installed TortoiseGit for Windows (still keep Github for Windows)
- I followed steps here exactly http://dancingmonkeysaccelerated.blogspot.com/2012/03/git-for-windows-with-tortoisegit-and.html
- I can get log and commit local
- 我运行Win7
- 我有私人 git repo 并安装了适用于 Windows 的 Github
- 我不喜欢 Windows 客户端的 Github(缺乏功能)。我为 Windows 安装了 TortoiseGit(仍然保留用于 Windows 的 Github)
- 我完全按照这里的步骤http://dancingmonkeysaccelerated.blogspot.com/2012/03/git-for-windows-with-tortoisegit-and.html
- 我可以获取日志并提交本地
- Then I Push
- 然后我推
- However it gave error
git did not exit cleanly (exit code 128)
- 但是它给出了错误
git did not exit cleanly (exit code 128)
I read this thread:
我读了这个线程:
How to resolve "git did not exit cleanly (exit code 128)" error on TortoiseGit?
如何解决 TortoiseGit 上的“git 没有完全退出(退出代码 128)”错误?
And actually changed SSH key by running Puttygen THREE TIMES already. I also set Full Permission for Users in the folder. Nothing works!!
实际上已经通过运行 Puttygen 三次更改了 SSH 密钥。我还在文件夹中为用户设置了完全权限。什么都没用!!
Here is what I see in Environment Path
这是我在环境路径中看到的
PATH=(others);C:\Users\myusername\AppData\Local\GitHub\PortableGit_93e8418133eb85e81a81e5e19c272776524496c6\libexec\git-core;
GIT_SSH=C:\Program Files\TortoiseGit\bin\TortoiseGitPLink.exe
SVN_SSH=C:\Program Files\TortoiseGit\bin\TortoiseGitPLink.exe
SSH_ASKPASS=C:\Program Files\TortoiseGit\bin\SshAskPass.exe
GIT_ASKPASS=C:\Program Files\TortoiseGit\bin\SshAskPass.exe
PATH=(others);C:\Users\myusername\AppData\Local\GitHub\PortableGit_93e8418133eb85e81a81e5e19c272776524496c6\libexec\git-core;
GIT_SSH=C:\Program Files\TortoiseGit\bin\TortoiseGitPLink.exe
SVN_SSH=C:\Program Files\TortoiseGit\bin\TortoiseGitPLink.exe
SSH_ASKPASS=C:\Program Files\TortoiseGit\bin\SshAskPass.exe
GIT_ASKPASS=C:\Program Files\TortoiseGit\bin\SshAskPass.exe
However: if I use Github for Windows
it works fine.
但是:如果我使用Github for Windows
它工作正常。
Can someone point me to a direction to troubleshoot this TortoiseGit issue?
有人能指出我解决这个 TortoiseGit 问题的方向吗?
采纳答案by HP.
I think I found a better alternative for Windows: http://www.syntevo.com/smartgithg/index.html
我想我找到了一个更好的 Windows 替代方案:http: //www.syntevo.com/smartgithg/index.html
It's been working so far. But I still prefer TortoiseGit if I can get it to work.
到目前为止它一直在工作。但如果我可以让它工作,我仍然更喜欢 TortoiseGit。
回答by MrTux
Generic answer
通用答案
Every time git.exe
is executed it returns an exit code (cf. Does git return specific return error codes?).
每次git.exe
执行它都会返回一个退出代码(参见git 是否返回特定的返回错误代码?)。
An exit code of
0
indicates success.
退出代码
0
表示成功。
In the StackOverflow post the exit code 128 is mentioned, which indicates an error:
在 StackOverflow 帖子中提到了退出代码 128,这表示错误:
The
(exit code 128)
is some kind of "unexpected error" (cf. https://stackoverflow.com/a/8059956/3906760). What it means is highly dependant on the git command executed and the output it issued. Therefore, there can't be a single easy and short answer on how to solve this.
这
(exit code 128)
是某种“意外错误”(参见https://stackoverflow.com/a/8059956/3906760)。它的含义高度依赖于执行的 git 命令及其发出的输出。因此,对于如何解决这个问题,不可能有一个简单而简短的答案。
The following post contains a specific answer which is related to the push case and at the end a more generic answer (If this doesn't help section).
以下帖子包含与推送案例相关的特定答案,最后是更通用的答案(如果这没有帮助部分)。
Answer for the case of the initial Stackoverflow post
对初始 Stackoverflow 帖子案例的回答
The following answer is based on the fact, that git.exe
was executed to run a push.
以下答案基于这样一个事实,即为git.exe
运行推送而执行的。
Using TortoiseGit with SSH
将 TortoiseGit 与 SSH 结合使用
Here one needs to differentiate between OpenSSH and PuTTY. (See here)
这里需要区分 OpenSSH 和 PuTTY。(见这里)
OpenSSH
开放式SSH
In order to use OpenSSH you have to set ssh.exe
as "SSH client" on TortoiseGit settings -> Network.
OpenSSH uses %HOME%/.ssh/id_rsa(.pub)
files for their public/private keys by default, which must be created by OpenSSH ssh-keygen
and not PuTTYGen (PuTTY keys have a different format, however, can also be converted using PuTTYGen).
If %HOME%
is not set, TortoiseGit will set it automatically, if you manually set %HOME%
please make sure it is valid (you might have to use slashes instead of backslashes).
为了使用 OpenSSH,您必须ssh.exe
在 TortoiseGit 设置 -> 网络上设置为“SSH 客户端”。默认情况下,
OpenSSH 使用%HOME%/.ssh/id_rsa(.pub)
文件作为其公钥/私钥,这些文件必须由 OpenSSHssh-keygen
而不是 PuTTYGen创建(PuTTY 密钥具有不同的格式,但也可以使用 PuTTYGen 进行转换)。
如果%HOME%
没有设置,TortoiseGit 会自动设置,如果你手动设置%HOME%
请确保它是有效的(你可能需要使用斜杠而不是反斜杠)。
This is recommended for people who already have their OpenSSH keys.
建议已经拥有 OpenSSH 密钥的人使用此方法。
PuTTY
油灰
PuTTY, which is to be preferred on Windows, requires that public/private keys are created using PuTTYGen (which is shipped with TortoiseGit).TortoiseGitPlink.exe
needs to be selected as ssh client on TortoiseGit settings -> Network - that should be the default. However, there is no default place for the public/private keys and, thus, these have to be configured. There are (at least two ways to do that):
PuTTY 是 Windows 上的首选,它要求使用 PuTTYGen(随 TortoiseGit 一起提供)创建公钥/私钥。TortoiseGitPlink.exe
需要在 TortoiseGit 设置 -> 网络上选择 ssh 客户端 - 这应该是默认值。但是,公钥/私钥没有默认位置,因此必须进行配置。有(至少有两种方法可以做到这一点):
Configure your key to be the default key in PuTTY based applications. For this, open PuTTY (which is not shipped with TortoiseGit and has to be downloadedseparately). Then go to the Connection-> SSH -> Auth configuration page and select your .ppk file as "Private key for authentication", go back to the "Session" configuration page, select "Default Settings" there and hit save. -> From now on PuTTY and PLink will use this key for authentication.
In order to make TortoiseGit load a private key for using with PuTTY one has to configure it.
- For an existing repository:Choose a repository, open TortoiseGit settings -> Remote and select your remote repository configuration there (normally "origin"). Then select your private .ppk key and hit "Add new/Save".
- For a new repositorythe key can be selected while cloning. When pushing/pullingmake sure "Autoload putty key" is checked.
将您的密钥配置为基于 PuTTY 的应用程序中的默认密钥。为此,请打开 PuTTY(未随 TortoiseGit 提供,必须单独下载)。然后转到 Connection-> SSH -> Auth 配置页面并选择您的 .ppk 文件作为“用于身份验证的私钥”,返回“会话”配置页面,在那里选择“默认设置”并点击保存。-> 从现在开始 PuTTY 和 PLink 将使用此密钥进行身份验证。
为了让 TortoiseGit 加载一个与 PuTTY 一起使用的私钥,必须对其进行配置。
- 对于现有存储库:选择一个存储库,打开 TortoiseGit settings -> Remote 并在那里选择您的远程存储库配置(通常是“origin”)。然后选择您的私人 .ppk 密钥并点击“添加新的/保存”。
- 对于新存储库,可以在克隆时选择密钥。推/拉时,请确保选中“自动加载腻子键”。
More tips/tricks for using PuTTY.
If this doesn't help
如果这没有帮助
First of all we need to make sure that the right git.exe
is called - normally that should be the case as TortoiseGit tries hard to find the correct git.exe
on the system on first start-up. This can be easily done by going to the TortoiseGit settings -> General. There one should check whether "git.exe
Path" points to the right folder of "Git for Windows" (in must point to the bin folder of the Git for Windows installation, not the cmd folder - but this should happen automatically) - if msysgit (the development version of "Git for Windows") is used, it is necessary that the [MSYSGIT-INSTALL-PATH]\mingw\bin-folder
is on the path (i.e. entered in the Extern DLL Path textbox) in order to execute git.exe
(otherwise required .dll-files) cannot be found. (See TortoiseGit docs)
首先,我们需要确保git.exe
调用了正确的 - 通常情况下应该是这种情况,因为 TortoiseGit 会git.exe
在首次启动时努力在系统上找到正确的。这可以通过转到 TortoiseGit 设置 -> 常规轻松完成。应该检查“ git.exe
Path”是否指向“Git for Windows”的正确文件夹(必须指向 Git for Windows 安装的 bin 文件夹,而不是 cmd 文件夹——但这应该自动发生)——如果 msysgit(使用“Git for Windows”的开发版本,必须[MSYSGIT-INSTALL-PATH]\mingw\bin-folder
在路径上(即在 Extern DLL Path 文本框中输入)才能执行git.exe
(否则需要 .dll 文件)找不到。(参见TortoiseGit 文档)
Now click on "Check now" and check that the right version number appears next to the button (not no error message).
If this is working, git.exe
should be configured correctly and work with https.
现在单击“立即检查”并检查按钮旁边是否显示正确的版本号(不是没有错误消息)。
如果这有效,git.exe
则应正确配置并使用 https。
回答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 路径的字段。确保这指向正确的安装。
回答by Sujit Y. Kulkarni
In my case, I made that commit (victim of did-not-exit-cleanly) from Git Bash. And tried the next commit from Tortoise, which worked!
就我而言,我从 Git Bash 进行了该提交(未完全退出的受害者)。并尝试了 Tortoise 的下一次提交,成功了!