Git Email Notifications on Push

So I’m doing a private collab and hosting a git repo off my server. Got annoying pretty quick with these occasional emails “hey pushed xyz change that could affect abc for you, make sure to pull the latest”

Enter this script, post-receive-email

To get going with it, I did the following, (line breaks for readability here):

wget -O '/user/local/bin/post-receive-email' \

chmod a+x /usr/local/bin/post-receive-email

Next, link to this in your repo with ln -s /usr/local/bin/post-receive-email hooks/post-receive and add something like this to config

mailinglist = ","
envelopesender =
emailprefix = "[GIT] "

And that will notify the mailing list of any push that occurs. There’s a number of other options worth exploring by reading the post-receive-email bash script.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: