Hooks are (currently) exclusively configured per-repository, so there can be no active hooks before a repository is created.
If you just want to initialize some repository specific settings identically for all new repositories you might be able to use the repository template mechanism.
By using your own template you can
- install activated hooks (by providing a
- set configuration variables (by providing a
<template‑dir>/config file), and
- configure per-repository exclude rules or attributes (by providing a
Any configuration file that lives in a
.git directory can be placed in a template to serve as the initial copy for that file in new repositories initialized from the template. I suppose you could even provide initial objects and refs.
Once you have a template directory made up with your customizations you must tell
git init and
git clone where to find it. This can be done explicitly with the
--template option (Git 0.99.4 or later), or implicitly with the
GIT_TEMPLATE_DIR environment variable (Git 1.5.0 or later), or implicitly by setting the
init.templatedir configuration variable in the “global” (per-user) or “system” Git configuration files (i.e.
/etc/gitconfig (varies by installation); Git 1.7.1 or later).