2

I am trying to trigger a hook file at the time of commit, but this is not working in EGIT. The same hook file is being executed If I use git bash or tortoisegit. Am I missing anything in the installation? How to fix this. I appreciate your help. For your information, below are the details of my eclipse and eclipse git plugin[EGIT]

Eclipse IDE for Java Developers
Version: Mars Release (4.5.0)
Build id: 20150621-1200

and Eclipse EGit version:4.0.0.201506090130-r
SCM SM
  • 41
  • 1
  • 6

1 Answers1

2

Recent versions of EGit (4.x) support commit hooks. If you are on Mars you should already have it, if not try updating from EGit update site.

In order to run them on Windows you need unix-like bash. You can try with Git for Windows, Cygwin or Msys2. Put the folder with sh.exe on your path and EGit should be able to run your hooks.

Michał Grzejszczak
  • 2,599
  • 1
  • 23
  • 28
  • You are just awesome !! I downloaded Git for Windows, and then I downloaded Eclipse Mars... hooks are being triggered now... thanks again ! – SCM SM Sep 08 '15 at 19:04
  • 1
    Can you please provide more details here? I have Eclipse Neon on Windows 10 with Git for Windows 2.10.2 and it is NOT working. – Dave Mar 03 '17 at 20:37
  • 2
    I have just checked that latest Git for Windows only contains `git.exe`, `sh.exe` and `bash.exe`. However EGit checks if the environment supports hooks by checking if the file `cygpath.exe` is present somewhere on PATH. Simply add empty `cygpath.exe` file to your `/usr/bin` in Git for Windows folder and you should be fine. I don't think that `cygpath.exe` is itself required, so it can be an empty file. – Michał Grzejszczak Mar 05 '17 at 21:27