Something I always forget when setting up the post-receive hook for a new git repo

Catchy title for a blog post, huh?

Anyway, something I always (or almost always) forget to do every time when I set up a new git repo and set up the hook to send everyone an email on each `git push` is to edit `description` so the first email always starts “UNNAMED PROJECT” which drives me mad!

The full list of steps for setting this up I take are:

cd {git dir}/hooks
mv post-receive post-receive.bak
ln -s /usr/share/doc/git-core/contrib/hooks/post-receive-email post-receive
vi config # edit the config to give the hook an email address (see below)
vi description # *that* step – edit this to have your project name

The config should have something like this in it:

[hooks]
mailinglist = bunch-o-gits@example.com
emailprefix = “[URA git] ”

which will send it to a list you need to set up and give you something by which to filter the emails.

Later, gits!

[Update: that line linking to the post-receive-email script might be a bit Debian-specific, not sureā€¦]

Leave a Reply