0

Windows 7. Bash shell.

I've made a file called pre-commit with the following content but nothing happens.

#!/bin/bash
echo "PRE-COMMIT EXECUTE"
mvn compile
exit 1

First: I have seen references to .git/hooks and C:/GitInstalledDir/hooks for the file location so where exactly is this file suppose to go?

Second: If it's to go in ".git" what directory is this, my user directory?

edjm
  • 4,830
  • 7
  • 36
  • 65
  • 1
    .git is a directory created inside your working tree. – eftshift0 Mar 27 '17 at 12:34
  • 1
    You might find [this SO post](http://stackoverflow.com/questions/23384196/how-to-run-git-hook-script-on-windows-using-repository-through-filesystem) helpful. – AlG Mar 27 '17 at 12:35
  • Thank you both! Very helpful link you provided................"Every Git repository has a .git/hooks folder with a script for each hook you can bind to." – edjm Mar 27 '17 at 12:39

0 Answers0