How to get email diffs for GitHub pushes? How to get email diffs for GitHub pushes? git git

How to get email diffs for GitHub pushes?


I've written a small WebHook that exactly fills this gap: gitdub. It leverages git-notifier to send one email per commit.


You are right, the GitHub Email Service hook doesn't include diff: this is currently a feature request.

J-16 SDIZ is also right, git-hook-update-notify-email would only be executed locally, not on GitHub side.

That doesn't mean said script cannot help: the idea would be to

  • setup a bare repo on your side, cloning the GitHub repo
  • setup a clone of that base repo
  • have a cron job (or Windows task) fetching the GitHub repo every 10 minutes
  • immediately push to the local non-bare repo

In the local non-bare repo, you can:

  • either use a pre-receive hook (which, as described in the Git book, could be use to compute diff between old-rev and new-rev)
  • or use the aforementioned git-hook-update-notify-email

In both cases, that mean setup this kind of service locally, which is not ideal.


May not be the ideal answer for you but if you set up gitolite on your own server you can setup git-commit-notifer, get beautiful colored diff emails, and have unlimited git accounts since you own the server. I do this, and I have never looked back.

Don't have a server? You can get a micro Amazon EC2 instance for dirt cheap ($15 a month). We have up to 12 developers and 10 git repos and it all works great on a micro instance.