I used to launch git gui within my cygwin console without any problems but since I updated cygwin I\'ve got the following error message:
$ git gui
Applicatio
Avoid X11 and add git gui
support to cygwin
If you want to avoid X11 (and who wouldn't?):
C:\Program Files (x86)\Git\Git Bash
git gui
(optional) If you want to stay in cygwin to launch git gui
, add a function in your ~/.bashrc
to do it. The only caveat is do not name the function git
because of recursion and confusion with arguments, and the fact that you're Git for Windows shell may also be adding the same function when it starts. You may also run into path issues so be careful about setting up your paths correctly.
# call git gui from Git For Windows path with `ggui`
gg() {
command "/cygdrive/c/Program Files (x86)/Git/bin/git" gui 2>/dev/null;
}
When you're done editing your .bashrc, refresh your settings:
source ~./bashrc
and then simply:
gg
After spending more time than I'd care to admit, I managed to find a working solution to execute gitk
from my cygwin shell. I couldn't get any of the instructions with starting the X server to work reliably, and in the end, the solution was pretty simple.
The largest caveat is needing to have Git for Windows installed, the download for that can be found here.
Now for the whole running gitk
part. Git for windows includes a cmd folder, that has a gitk.cmd
windows command file. That's all you need to call to have gitk
open.
$ [path-to-git]/cmd/gitk.cmd
On my system the Git path is in "C:\Program Files (x86)\Git" so the command would look like this:
$ "/cygdrive/c/Program Files (x86)/Git/cmd/gitk.cmd"
In my ~/.bash_profile I've added a function to handle that call which looks like this:
gitk() {
"/cygdrive/c/Program Files (x86)/Git/cmd/gitk.cmd"
}
Hope this helps someone else trying to figure this piece out.
Here is what worked for me:
cat >> ~/.bash_profile <<< "export DISPLAY=:0.0"
From cygwin package manager, do the following:
install xorg-server
and some xorg fonts, xorg-x11-fonts-Type1
especially
Next create a link to windows font folders for git gui
to use
ln -s /cygdrive/c/Windows/Fonts /usr/share/fonts/win-fonts
Close the cygwin terminal and open again then type
startxwin &> /dev/null &
git gui &
After following the 4 steps given by me_and and tititou36, you may still have issues of the XWin just die after you started the XwinServer.
The reason is it relies on a CygWin terminal/console, which is the host, and the Xwin dies if there is no CygWin console.
The solution for this is:
Start a Cygwin console. (you can make it automatically start by putting mintty
command into the file .startxwinrc
under your cygwin home directory.
echo "export DISPLAY=:0.0" >>~/.profile
or
echo "export DISPLAY=:0.0" >>~/.bash_profile
in my case
Based on AndrewD's answer: Use cygwin's git
, but use Windows Git's gitk
and git gui
. In other words, uninstall the git-gui and gitk packages from cygwin (if installed). Then which gitk
should point to the Windows file, not the cygwin binary in /usr/bin
.