I\'m using post-receive-email hook from the Git distribution to send e-mails to certain users when Git repository is updated (hook invoked from post-recei
You can look at the doc hook for starters:
where do I (the admin) put the hooks?
In general, all hooks go into the
hooks/commondirectory. Only the special post-update hook meant for theadminrepo goes intohooks/gitolite-admin.
But the GitoliteV3 doc on 'mirroring' provides an alternative to a custom hook.
For the second question:
I would like to avoid editing config file for each repository manually.
It would be much more fun if I could configure everything in the same, centralized, place for whole Gitolite.
The doc gitolite.conf is quite clear:
repo specific git config commands
Sometimes you want to specify
git configsettings for some of your repos.
For example, you may have a custom post-receive hook that sends an email when a push happens, and this hook needs to know whom to send the email to, etc.You can set
git configvalues by specifying something like this within a "repo" paragraph:example usage: if you placed a hook in
hooks/commonthat requires configuration information that is specific to each repo, you could do this:
repo gitolite
config hooks.mailinglist = gitolite-commits@example.tld
config hooks.emailprefix = "[gitolite] "
config foo.bar = ""
config foo.baz =
The syntax is simple:
config sectionname.keyname = [optional value_string]
This does either a plain "
git config section.key value" (for the first 3 examples above) or "git config --unset-all section.key" (for the last example).
Other forms (--add, thevalue_regex, etc) are not supported.Note: this won't work unless the
rcfile has the right settings; please see comments around the variable$GL_GITCONFIG_KEYS$GIT_CONFIG_KEYS(now in GitoliteV3 or 'g3') in gitolite rc file for details and security information.