create ´~/.git_template/hooks/pre-commit´ file
#!/usr/bin/python
import os
import sys
username = os.popen("git config user.name").read()
usermail = os.popen("git config user.email").read()
if username == "" or usermail == "":
message = "No git user identity found"
title = "Git Commit Abort"
os.system("terminal-notifier -message '"+message+"' -title '"+title+"' > /dev/null")
print '\033[91m' + title+": "+message + '\033[0m'
print "for ignore this hook on this repository:"
print "rm "+os.popen("pwd").read().strip(' \t\n\r')+"/.git/hooks/pre-commit"
exit(1)
install terminal-notifier
sudo gem install terminal-notifier
set git hook template
git config --global init.templatedir '~/.git_template'