11

I am using MSYS2 in Windows 10. git works fine, however gitk gives the error:

/usr/bin/gitk: line 3: exec: wish: not found

Some googling suggested this may be because TK is not installed, however I tried:

pacman -S tk

which gave the error:

error: target not found: tk

How do I get gitk to work in this environment?

M.M
  • 138,810
  • 21
  • 208
  • 365

2 Answers2

12

Try running the 64-bit MinGW shell (one of the three environments provided by MSYS2), installing the package mingw-w64-x86_64-tk, and then running gitk.

Gitk works on my system, and wish is provided /mingw64/bin/wish.exe.

David Grayson
  • 84,103
  • 24
  • 152
  • 189
  • 2
    I had to add `/mingw64/bin` to `$PATH`, but this seems to work. – jpmc26 Mar 31 '16 at 18:06
  • 1
    That's odd. That directory should already be on your PATH if you launch MSYS2 with the "MinGW-w64 Win64 Shell" shortcut in your Start Menu or use mingw64_shell.bat. – David Grayson Mar 31 '16 at 18:21
  • 2
    Well, since I didn't... ;) Apparently, I skimmed over the "running the 64-bit MinGW shell" part. Sorry about that. – jpmc26 Mar 31 '16 at 18:37
  • To make bash use mingw64, make sure you `set MSYSTEM=MINGW64` before starting bash.exe – qwertzguy Apr 22 '16 at 14:11
  • And to make git gui work, add this to your .bashrc: `GIT_GUI_LIB_DIR=/c/msys64/usr/share/git-gui/lib` – qwertzguy Apr 22 '16 at 14:12
0

I confirm C:\prgs\git\PortableGit-2.7.0-64-bit\cmd\gitk.exe works just fine.

Make sure you are executing it from a regular CMD session or from C:\prgs\git\PortableGit-2.7.0-64-bit\git-bash.exe

I would not try and run it from a Cygwin session.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Wha tis the installation procedure for obtaining that version? (without wrecking my existing msys2 git installation) – M.M Jan 25 '16 at 07:42
  • @M.M Simply uncompress `PortableGit-2.7.0-64-bit.7z.exe` and update your %PATH%, as described in http://stackoverflow.com/a/34960864/6309: that links give you a detailed installation process, with links to fetch `PortableGit-2.7.0-64-bit.7z.exe`. – VonC Jan 25 '16 at 07:52
  • You can solve this problem within the MSYS2 environment without downloading third-party executables; see my answer. – David Grayson Jan 25 '16 at 08:19
  • @DavidGrayson you don't need msys2 framework for working with git on Windows: the git-for-windows project already uses msys2: see http://stackoverflow.com/a/26826359/6309 – VonC Jan 25 '16 at 08:20
  • 1
    I am assuming that OP has the need to use MSYS2 for some other reason, and now tries to run gitk from within it. So using a Git distribution which also already includes MSYS2 seems counter-intuitive. – poke Jan 25 '16 at 08:28
  • 1
    @poke you really don't want to use msys2 just for using git on Windows. – VonC Jan 25 '16 at 08:33
  • I'm trying msys2 as a more lightweight alternative to a full cygwin install – M.M Jan 25 '16 at 09:07
  • @M.M You really don't need it. At all. And you don't need Cygwin either. The `git-bash.exe` packaged with git will open a modern msys2-based bash session. – VonC Jan 25 '16 at 09:09
  • @VonC I strongly disagree. I've been using MSYS2 primarily for git for coming on 2 years now, and I'm quite happy. This sort of issue is exactly *why* I prefer MSYS2 directly: I can more easily install companion software I need. The only real downside is the fact that every piece of Windows software that depends on git and its brother assumes `git.exe` is globally installed and on your path, something I continue to refuse to do, but I've gotten along pretty well without depending on any of that. – jpmc26 Apr 02 '16 at 00:50
  • @jpmc26 Well... I suppose that with the recent Ubuntu bash on Windows(!) (http://blog.dustinkirkland.com/2016/03/ubuntu-on-windows.html?m=1, https://channel9.msdn.com/Events/Build/2016/P488, https://channel9.msdn.com/Events/Build/2016/C906)... the all debate will become moot :) I mean, `sudo apt-get install git` will be possible! – VonC Apr 02 '16 at 04:27
  • @VonC I saw that. I'm horrified and expect it to be terrible. Plus I'm on Windows 7. – jpmc26 Apr 02 '16 at 04:55
  • 1
    @jpmc26 After listening to Steve Gibson on Security Now (https://www.grc.com/securitynow.htm), who is just migrating from Xp(!) to Windows 7 (and intent to remain on 7 for the next 15 years), I hope you have downloaded Gitbson's small utility "never 10": https://www.grc.com/never10.htm – VonC Apr 02 '16 at 04:58