使用新版本的Cygwin,安裝時出現很多問題。------------------留作參考----------------------
首先從官網下載setup.exe後運行安裝,選擇需要的包。
在終端輸入gitk後出現錯誤:
Application initialization failed: no display name and no $DISPLAY environment variable
解決方案:http://stackoverflow.com/questions/9393462/cannot-launch-git-gui-using-cygwin-on-windows
As of a recent Tcl/Tk update , Cygwin now uses X11 instead of GDI. In short, this means you need to install some of the Cygwin X11 packages and set them up to be able to open the GUI.
This should get you back up and running:
- Run the Cygwin installer again (download setup.exe again if you need to).
- At the package list, select to install "xinit" and "X-start-menu-icons"; both are under the X11 category. Click next, accept all the dependencies, and install.
- In the Windows Start menu, you should have a new group: Cygwin-X. From there, run XWin Server.
- In your Cygwin shell, run
export DISPLAY=:0.0
.
You'll need to repeat step 3 every time you reboot your computer, and step 4 every time you open a new Cygwin shell (or just run echo
"export DISPLAY=:0.0" >>~/.profile
to have it run automatically whenever you create a new shell).
For the interested, the reason the X11 packages aren't installed automatically is that they're not technically needed : it's possible through somewhat convoluted means to use a different X11 server than the one Cygwin installs when you install the "xinit" package
也就是說新版本的Cygwin需要X11了,所以要裝上 xinit" and "X-start-menu-icons";
另外,運行的時候:
1. 運行cygwin的安裝程序,安裝 Xorg Server 和Xinit
2. 運行cygwin,輸入startx
3. 運行gitk或者git gui