TortoiseGit - 找不到 git
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1389281/
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 - git not found
提问by alexandrul
I'm using TortoiseGit with msysGit installed with the msysGit-fullinstall-1.6.4-preview20090729.exe
and it works in a very strange way:
我正在使用 TortoiseGit 并安装了 msysGit msysGit-fullinstall-1.6.4-preview20090729.exe
,它以一种非常奇怪的方式工作:
- on the
About
windows it says it can't find git, even if all the operations seems to complete ok - on the
Settings
window,General
tab,MSysGit
section, the version is blank even with the correct path set (....\msysGit\bin) - on the
Settings
window,Git\Config
tab, any attempt to alter and save the settings lead to some stange text-less error, and the only way to close the window is by `Cancel' button - on every operation it seems to look for git.exe on all the folders in path, which is at least strange, given that it knows exactly where to find the executable
- 在
About
Windows上,它说它找不到 git,即使所有操作似乎都完成了 - 在
Settings
窗口、General
选项卡、MSysGit
部分上,即使设置了正确的路径,版本也是空白的 (....\msysGit\bin) - 在
Settings
窗口Git\Config
选项卡上,任何更改和保存设置的尝试都会导致一些无文本错误,关闭窗口的唯一方法是通过“取消”按钮 - 在每个操作中,它似乎都在路径中的所有文件夹上查找 git.exe,这至少很奇怪,因为它确切地知道在哪里可以找到可执行文件
The first three points are not present if I install msysGit with the Git-1.6.4-preview20090730.exe
, even if the path is set the same in both cases (....\msysGit\cmd)
如果我使用 安装 msysGit,则前三点不存在Git-1.6.4-preview20090730.exe
,即使在两种情况下路径设置相同 (....\msysGit\cmd)
What can I do to make TortoiseGit recognise git installation from the msysGit-fullinstall-1.6.4-preview20090729.exe
?
我该怎么做才能让 TortoiseGit 识别 git 安装msysGit-fullinstall-1.6.4-preview20090729.exe
?
Environment:
环境:
- Git-1.6.4-preview20090730.exe
- msysGit-fullinstall-1.6.4-preview20090729.exe
- TortoiseGit 1.0.2.0 32bit
- Git-1.6.4-preview20090730.exe
- msysGit-fullinstall-1.6.4-preview20090729.exe
- TortoiseGit 1.0.2.0 32 位
EDIT:
编辑:
I don't want to put msysGit\bin
in path, just msysGit\cmd
.
我不想放入msysGit\bin
路径,只是msysGit\cmd
.
If I simply replace the files from msysGit-fullinstall-1.6.4-preview20090729.exe
with the files from an Git-1.6.4-preview20090730.exe
installation, then TortoiseGit seems to recognize the git version and allows me to edit the Git\Config section in the settings. This is at least strange, given that the rest of the environment is not modified at all.
如果我只是从替换文件msysGit-fullinstall-1.6.4-preview20090729.exe
从一个文件Git-1.6.4-preview20090730.exe
安装,然后TortoiseGit似乎认识到Git版本,并允许我编辑在设置的Git \ Config部分。考虑到环境的其余部分根本没有修改,这至少很奇怪。
As soon as I restore the msysGit-fullinstall-1.6.4-preview20090729.exe
files, TortoiseGit cease to function properly.
一旦我恢复msysGit-fullinstall-1.6.4-preview20090729.exe
文件,TortoiseGit 就停止正常运行。
采纳答案by Andrei
While this question is still hot... some nice people contributed lots of bugfixes to all three projects, so this is what I did to get TortoiseGit on Win7x64, previously failing on all combinations:
虽然这个问题仍然很热门......一些好人为所有三个项目贡献了很多错误修正,所以这就是我在 Win7x64 上获得 TortoiseGit 所做的事情,以前在所有组合上都失败了:
- install mSysGit(network installer) into C:\msysgit, it will download the source and compile it leaving you in a bash git prompt. Stable version: msysGit-netinstall-1.7.2.3-preview20100911.exe13 sep
- install Git “preview”into C:\Program Files (x86)\Git, choose OpenSSH for ssh link Stable version: Git-1.7.2.3-preview20100911.exe13 sep
- install tortoisegitinto C:\Program Files\TortoiseGit, (x64 version) and configure it's settings specifying the git path (C:\msysgit\bin) and menu integration. Stable version: TortoiseGit-1.5.6.0-64bit.msi25 sep
- 将mSysGit(网络安装程序)安装到 C:\msysgit 中,它将下载源代码并编译它,让您进入 bash git 提示符。稳定版:msysGit-netinstall-1.7.2.3-preview20100911.exe13 sep
- 将Git“预览版”安装到 C:\Program Files (x86)\Git,ssh 链接选择 OpenSSH 稳定版:Git-1.7.2.3-preview20100911.exe13 sep
- 将tortoisegit安装到 C:\Program Files\TortoiseGit,(x64 版本)并配置它的设置,指定 git 路径 (C:\msysgit\bin) 和菜单集成。稳定版:TortoiseGit-1.5.6.0-64bit.msi25 sep
This setup picked up my existing git repos made on WinXP x86 with older versions of the packages, and seems fairly stable and fully functional.
此设置采用了我在 WinXP x86 上使用旧版本软件包制作的现有 git 存储库,并且看起来相当稳定且功能齐全。
回答by guesser
I've had nothing but problems with TortoiseGit.
我只有 TortoiseGit 的问题。
However, discovering the following enabled me to give up sooner:
但是,发现以下内容使我能够更快地放弃:
In your Path (in Control Panel->System->Advanced Settings->Environment Settings), add a path that contains git.exe (msysgit\bin or msysgit\git? TortoiseGit's instructions sure the hell don't tell me, so how should I know). Then open a command prompt and try running git.exe. It'll probably complain that it can't find libcurl-4.dll. So, you'll find that this dll file exists in msysgit\mingw\bin. Add this directory to your Path (or copy the dll if you prefer).
在您的路径(在控制面板->系统->高级设置->环境设置)中,添加一个包含 git.exe 的路径(msysgit\bin 或 msysgit\git?TortoiseGit 的说明肯定不会告诉我,那么如何我应该知道)。然后打开命令提示符并尝试运行 git.exe。它可能会抱怨找不到 libcurl-4.dll。所以,你会发现这个dll文件存在于msysgit\mingw\bin中。将此目录添加到您的路径(或者,如果您愿意,可以复制 dll)。
Now, the setup in TortoiseGit will finally appear to work. Clicking the "Check Now" button will actually tell you the version of git you're using instead of mysteriously going blank or popping up a useless error window.
现在,TortoiseGit 中的设置终于可以正常工作了。单击“立即检查”按钮实际上会告诉您正在使用的 git 版本,而不是神秘地变为空白或弹出无用的错误窗口。
When you try using TortoiseGit now, you'll get a blank progress bar that does nothing and you can't close it. Congratulations! Now you can give up and delete this garbage until someone cares enough to prepare it for human consumption. (can you tell I'm fed up with this software?)
当你现在尝试使用 TortoiseGit 时,你会得到一个空白的进度条,它什么也不做,而且你无法关闭它。恭喜!现在您可以放弃并删除这些垃圾,直到有人足够关心以准备供人类消费为止。(你能说我厌倦了这个软件吗?)
回答by guesser
Well, since my post, I actually got TortoiseGit working on one of my two systems. Adding the msysgit\mingw\bin directory to the path (so that git.exe could find libcurl-4.dll and thus not cause everything to silently fail) was the final key. I was able to do it using the default TortoisePlink.exe and didn't have to set GIT_SSH or anything like that. I could say it was easy (in retrospect, it's easy enough..) but in truth it took about two coding sessions that I would have preferred to spend more productively.
好吧,自从我发帖以来,我实际上让 TortoiseGit 在我的两个系统之一上工作。将 msysgit\mingw\bin 目录添加到路径中(这样 git.exe 可以找到 libcurl-4.dll,从而不会导致一切静默失败)是最后的关键。我能够使用默认的 TortoisePlink.exe 来完成它,而不必设置 GIT_SSH 或类似的东西。我可以说这很容易(回想起来,这很容易......)但实际上它花了大约两个编码会话,我希望能更有效地花费。
回答by Ibrahim
This might be obvious, but it's not clear from your post. Do you have msysgit\bin
in your system path?
这可能很明显,但从您的帖子中并不清楚。你有没有msysgit\bin
在你的系统路径?
Also, this isn't quite answering your question, but I've found that TortoiseGit lacks polish. I prefer using Git Extensions.
此外,这并不能完全回答您的问题,但我发现 TortoiseGit 缺乏完善。我更喜欢使用Git 扩展。
回答by alexandrul
It seems that bash prompt from msysGit-fullinstall-1.6.4-preview20090729.exe
also adds msysGit\mingw\bin
to path, so in order to use TortoiseGitand/or Git ExtensionsI have copied all the files from msysGit\mingw\bin
to msysGit\bin
and set the location to git.exe
in both tools.
似乎 bash 提示 frommsysGit-fullinstall-1.6.4-preview20090729.exe
也添加msysGit\mingw\bin
到路径中,因此为了使用TortoiseGit和/或Git 扩展,我已将所有文件从msysGit\mingw\bin
to复制msysGit\bin
并git.exe
在两个工具中将位置设置为。
回答by MrTux
Answer for recent versions of TortoiseGit (>= 1.8.16 and >= 2.0)
TortoiseGit 最新版本的答案(>= 1.8.16 和 >= 2.0)
As mentioned on the FAQTortoiseGit requires a command line git.exe. There are several alternatives available, however, Git for Windowsis recommended which should work out of the box.
正如常见问题解答中提到的TortoiseGit 需要命令行 git.exe。有几种替代方案可用,但是,建议使用Git for Windows,它应该是开箱即用的。
The recommended order is to install TortoiseGit first. TortoiseGit will then (hopefully automatically) detect the installed git.exe by checking for Git for Windows installations, looking on the %PATH%
or manual configuration (TortoiseGit settings).
推荐的顺序是先安装 TortoiseGit。然后,TortoiseGit 将(希望自动)通过检查 Windows 安装的 Git,查看%PATH%
或手动配置(TortoiseGit 设置)来检测已安装的 git.exe 。