Steps to setup git notify emails
1. chmod a+x /usr/share/doc/git-core/contrib/hooks/post-receive-email2. cd ~/your-project-repository/.git/hooks/
3. ln -s /usr/share/doc/git-core/contrib/hooks/post-receive-email post-receive
4. cd ~/your-project-repository/.git/
5. open config file
6. add the following code
[hooks] mailinglist = your@email.address,second@email.address
showrev = “git show -C %s; echo”
emailprefix = “[Your Prefix] “
When you receive an email after you did a git push, you probably can only see the summary of changes. If you want to see the full details in what you have changed from the last commit, then follow the steps below:
open /usr/share/doc/git-core/contrib/hooks/post-receive-email and go to find the following codes
echo “”
echo “Summary of changes:”
git diff-tree –stat –summary –find-copies-harder $oldrev..$newrev
Here git is asked for the diff, but then it is also asked to summarize it. Remove the –stat and –summary flags and you will see the diff.
git diff-tree –find-copies-harder $oldrev..$newrev
Here is another way that shows all revisions including diffs from $oldrev to $newrev
git –no-pager log –find-copies-harder $oldrev..$newrev