Setup an email notification on git commit

We will setup a git template so when you create a new git repository with “git init –bar project-name.git”, it will copy what you have in your git template directory.

  1. git config --global init.templatedir '~/.git-templates'
  2.  mkdir -p ~/.git-templates/hooks
  3. vim config and add this content and update the email addresses. It will be copied to your config file ever time you create a new git repository.
  4. vim descriptionand add your subject line “Git commit received on [project name]”.
  5. cd hooks
  6. vim post-commit
  7. Add the script from REF 1

mailinglist = ""
senderemail = ""

You are all set.