Why is my Git pre-commit hook not running in GitKraken
<p>I'm trying to enforce Git Flow on a Git repository. I used the following hook to try to prevent commits to the <code>master</code> and <code>develop</code> branches. Contents of <code>.git/hooks/pre-commit</code>:</p>

<pre><code>#!/bin/bash
if test $(git rev-parse --abbrev-ref HEAD) = "master" ; then 
  echo "Cannot commit on master"
  exit 1
fi
if test $(git rev-parse --abbrev-ref HEAD) = "develop" ; then 
  echo "Cannot commit on develop"
  exit 1
fi
</code></pre>

<p>When I test commits to these branches in GitKraken the commits are allowed. I made the Git was on the path and that the file showed as executable.</p>