title: Git hooks : applying `git config core.hooksPath`
body: <p>I have a git repository with a pre-commit hook set up :</p>
  
  <pre><code>my-repo
  |- .git
     |- hooks
        |- pre-commit     # I made this file executable
  </code></pre>
  
  <p>Until there, everything works. The hook is running when I commit.</p>
  
  <p>=================================</p>
  
  <p>I now run <code>git config core.hooksPath ./git-config/hooks</code> in <code>my-repo</code>.  </p>
  
  <p>The folder structure is this one : </p>
  
  <pre><code>my-repo
  |- .git
     |- hooks
  |- git-config
     |- hooks
        |- pre-commit     # I made this file executable as well
  </code></pre>
  
  <p>What happens is :</p>
  
  <ul>
  <li>the new pre-commit script doesn't run on commit</li>
  <li>the old pre-commit script still runs on commit if I leave it in <code>my-repo/.git/hooks</code></li>
  <li>running <code>git config --get core.hooksPath</code> in <code>my-repo</code> outputs <code>./git-config/hooks</code></li>
  </ul>
  
  <p><strong>How can I make the new pre-commit hook run on commit ?</strong></p>
  
  <p>Here's the link to the docs I apparently don't understand well :<br>
  <a href="https://git-scm.com/docs/git-config" rel="noreferrer">https://git-scm.com/docs/git-config</a><br>
  <a href="https://git-scm.com/docs/githooks" rel="noreferrer">https://git-scm.com/docs/githooks</a>  </p>