bash Cygwin gitk 问题
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9248034/
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
Cygwin gitk issue
提问by bubblebath
I have recently installed all of the X11 packages in the cygwin setup and now have is massive annoying error with not being able to see gitk. Everything was working perfectly well until I installed this stuff.
我最近在 cygwin 设置中安装了所有 X11 软件包,现在出现了大量烦人的错误,无法看到 gitk。在我安装这些东西之前,一切都运行良好。
Before I had this issue I didn't really note done any of the configuration I merely started xwinserver went to my branch and typed gitk and everything appeared. Now I have to put in my display as it claims the display is not set. I export my display settings check that it is set properly by running xclock which does appear. Then I get the issue:
在我遇到这个问题之前,我并没有真正注意到完成任何配置我只是启动 xwinserver 去我的分支并输入 gitk 并且一切都出现了。现在我必须放入我的显示器,因为它声称没有设置显示器。我导出我的显示设置,通过运行出现的 xclock 检查它是否设置正确。然后我得到了这个问题:
1 [main] wish8.5 3436 child_info_fork::abort: data segment start: parent(0x4CF000) != child(0x67F000) Error in startup script: unknown color name "SystemButtonFace" while executing "winfo rgb . $c" (procedure "setui" line 3) invoked from within "setui $uicolor" (file "C:\cygwin\bin\gitk" line 11504)
Not got a clue what this is. I have seen a couple of relevant questions but no answers.
不知道这是什么。我看到了几个相关的问题,但没有答案。
Notes: I am using Windows 7 64 bit and using a Bash shell
注意:我使用的是 Windows 7 64 位并使用 Bash shell
Update: I am still getting exactly the same error. This is really frustrating! I may just download Debian
更新:我仍然遇到完全相同的错误。这真是令人沮丧!我可以只下载 Debian
回答by Ashutosh Jindal
I was able to get gitk working as of today with the following versions on Win 7 64 Bit :
截至今天,我能够在 Win 7 64 Bit 上使用以下版本使 gitk 工作:
$ cygcheck -c cygwin git gitk tcl tcl-tk
Cygwin Package Information
Package Version Status
cygwin 1.7.10-1 OK
git 1.7.9-1 OK
gitk 1.7.9-1 OK
tcl 8.5.11-1 OK
tcl-tk 8.5.11-1 OK
The most valuable link was the one posted by aap. That led me to all the other steps.
最有价值的链接是 aap 发布的链接。这使我进行了所有其他步骤。
To fix the fork failures follow thislink from Cygwin FAQ. The steps I followed were as follows:
要修复分叉故障,请遵循Cygwin 常见问题解答中的此链接。我遵循的步骤如下:
Start -> Run -> ash.exe -> /bin/rebaseall(There was no output when I ran that command)
One of the reasons why you might get fork failures is the presence of Antivirus/Firewall/Spyware-cleaner softwares.
In my case the BLODAsoftwares listed as reasons for the fork failures was McAfee which I have on my work pc. The fix was to move the Cygwin directory inside a folder excluded by McAfee's OAS and create a symbolic link to the old location like so:mklink /D C:\Cygwin C:\Dev\Cygwin
C:\Devis the excluded folder
The folder exclusions can be configured using the Viruscan Console. To test whether your current Cygwin directory is excluded see this.Starting GITK
- Method 1
- In Cygwin Console :
startx& - The title of the window that pops up must be used to set the DISPLAY env variable in Cygwin like so:
Title : Cygwin/X:1.0, then doexport DISPLAY=localhost:1.0
Title : Cygwin/X:0.0, then doexport DISPLAY=localhost:0.0 - Finally start gitk like so :
gitk& - What I ended up with was this :

- In Cygwin Console :
- Method 2
- Create a file ~/.startxwinrcwith the following contents:
gitk& - Then run the following command:
startxwin >/dev/null 2>&1 - I ended up with a gitk window which looks exactly like the one before the whole 'require X' thing mentioned by aap happened :

- Create a file ~/.startxwinrcwith the following contents:
- Method 1
开始 -> 运行 -> ash.exe -> /bin/rebaseall(运行该命令时没有输出)
分叉失败的原因之一是防病毒/防火墙/间谍软件清理软件的存在。
在我的情况下,列为 fork 故障原因的BLODA软件是 McAfee,我的工作电脑上有它。修复方法是将 Cygwin 目录移动到 McAfee 的 OAS 排除的文件夹中,并创建指向旧位置的符号链接,如下所示:mklink /D C:\Cygwin C:\Dev\Cygwin
C:\Dev是排除的文件
夹 文件夹排除可以使用 Viruscan 控制台进行配置。要测试您当前的 Cygwin 目录是否被排除在外,请参阅此内容。启动 GITK
- 方法一
- 在 Cygwin 控制台中:
startx& - 弹出窗口的标题必须用于在 Cygwin 中设置 DISPLAY 环境变量,如下所示:
Title : Cygwin/X:1.0,然后执行export DISPLAY=localhost:1.0
Title : Cygwin/X:0.0,然后执行export DISPLAY=localhost:0.0 - 最后像这样启动gitk:
gitk& - 我最终得到的是这样的:

- 在 Cygwin 控制台中:
- 方法二
- 创建一个文件~/.startxwinrc,内容如下:
gitk& - 然后运行以下命令:
startxwin >/dev/null 2>&1 - 我最终得到了一个 gitk 窗口,它看起来与 aap 提到的整个“需要 X”事情发生之前的那个完全一样:

- 创建一个文件~/.startxwinrc,内容如下:
- 方法一
回答by aap
Seems there are three issues here.
这里似乎有三个问题。
DISPLAY requirement is due to Cygwin Tk changing to require X.
SystemButtonFace error is also due to the same change. The recommended fix is to remove your ~/.gitksettings file, or at least the line in that file referencing SystemButtonFace.
fork issue -- seems to require rebaseall.
显示要求是由于 Cygwin Tk 更改为要求 X。
SystemButtonFace 错误也是由于同样的变化。推荐的修复方法是删除您的 ~/.gitk设置文件,或者至少是该文件中引用 SystemButtonFace 的行。
fork 问题——似乎需要rebaseall。
Note also that there is an updated version 1.7.9 of git and gitk finding its way to the cygwin mirrors, but by itself that version did not solve the problem for me.
另请注意,git 和 gitk 的更新版本 1.7.9 找到了通往 cygwin 镜像的途径,但该版本本身并没有为我解决问题。
回答by bender
Based on the above answer, I did a different fix. In my ~/.bash_profile, I added the following:
根据上面的答案,我做了一个不同的修复。在我的 中~/.bash_profile,我添加了以下内容:
startxwin >/dev/null 2>&1
export DISPLAY=localhost:0.0
I think that's a better solution than adding gitk& to the ~/.startxwinrc, since then it only works with gitk. This way you can then do git gui and other things as well.
我认为这是一个比将 gitk& 添加到 ~/.startxwinrc 更好的解决方案,因为它只适用于 gitk。这样你就可以做 git gui 和其他事情。
回答by me_and
The solutions everyone else is posting are relating to Tcl/Tk's new reliance on X11. Actually, the error you're seeing is a follow-on error due to having run gitk under GDI before the X11 requirement came along.
其他人发布的解决方案与Tcl/Tk 对 X11 的新依赖有关。实际上,您看到的错误是由于在 X11 要求出现之前在 GDI 下运行 gitk 而导致的后续错误。
The fixis to edit your ~/.gitkfile, and delete any lines that refer to SystemButtonFace. Once you've done that, everything should Just Work? again.
解决方法是编辑您的~/.gitk文件,并删除所有引用SystemButtonFace. 一旦你这样做了,一切都应该正常工作?再次。
回答by page
The other answers suggesting to remove ~/.gitk pointed in the right direction, but in new releases the config file is in ~/.config/git/gitk by default, as pointed by the manual.
建议删除 ~/.gitk 的其他答案指向正确的方向,但在新版本中,默认情况下,配置文件位于 ~/.config/git/gitk 中,如手册所述。
回答by Steven Penny
Based on bender's answer
基于本德的回答
- Install xinit package
- Go go
C:\cygwin\bin, double clickash.exe - enter
./rebaseall
- 安装 xinit 包
- 去吧
C:\cygwin\bin,双击ash.exe - 进入
./rebaseall
Then you can start gitkwith
然后就可以开始gitk使用
startxwin
gitk
回答by kyleus
I got the same error. The issue was that I initially used git bashand later switched to using git in cygwin.
我得到了同样的错误。问题是我最初使用git bash,后来在cygwin 中切换到使用 git 。
Git bash's gitk had created a ~/.gitk file that was incompatible with cygwin's tcl/tk. If you delete ~/.gitk, when you run cygwin's gitk it will create a new file.
Git bash 的 gitk 创建了一个 ~/.gitk 文件,该文件与 cygwin 的 tcl/tk 不兼容。如果删除 ~/.gitk,当您运行 cygwin 的 gitk 时,它会创建一个新文件。
回答by bubblebath
In the end I had to remove cygwin and re-install it. The issue lies somewhere in the X11 for me. When I re-installed I had to rebaseall as I had a fork issue so these answers really helped. I did have to set the display as well so that is going in my .bashrc
最后我不得不删除 cygwin 并重新安装它。对我来说,问题出在 X11 的某个地方。当我重新安装时,我不得不 rebaseall,因为我有一个 fork 问题,所以这些答案真的很有帮助。我确实也必须设置显示,以便在我的 .bashrc 中进行
I'm sorry that I can not provide something more concrete, however, whatever I tried my same issue kept reappearing.
很抱歉,我无法提供更具体的内容,但是,无论我尝试过什么,我的相同问题都不断重新出现。

