title: Git pre-commit hook is not running on Windows
body: <p>I'm just starting to look into Git hooks, but I can't seem to get them to run.</p>
  <p>I set up a local repository, so there is now a '.git' directory in my project folder. I have added a '.cmd' file into the C:/path/to/my/project/.git/hooks directory named 'pre-commit.cmd'. Here is the contents of this file:</p>
  <pre><code>echo &quot;HOOK RUNNING&quot;
  echo. 2&gt;C:/path/to/my/project/.git/hooks/EmptyFile.txt
  </code></pre>
  <p>This should echo the text &quot;HOOK RUNNING&quot; and create an empty text file in that directory. However, if I commit changes through my IDE (<a href="https://en.wikipedia.org/wiki/NetBeans" rel="noreferrer">NetBeans</a>) or use <a href="https://superuser.com/questions/1053633/what-is-git-bash-for-windows-anyway">Git Bash</a> to commit, neither of them seem to run my pre-commit hook, as no file is created.</p>
  <p>My understanding is that all you have to do to get a hook to run is add an executable with the name of the hook (as I have done). Am I doing something wrong?</p>
  <p>Note: This is on a Windows 7 PC.</p>