title: git hooks bash -- getting the commit message
body: <p>I am writing a git hook, to run on a commit to the main branch. I need it to parse and look for some text in the the commit message. How do I reference the commit message in my bash script?</p>
  
  <p>Also I would like to know how to run the hook only on commits to the main branch. so developers can quash there local commits and commit to  the main branch when they have fixed a bug or something. </p>
  
  <p>Please and thank you. </p>