I would like to automatically populate the .git/hook/pre-push/pre-commit file with custom content whenever someone clone my repositories.
How can I achieve that ?
I would like to automatically populate the .git/hook/pre-push/pre-commit file with custom content whenever someone clone my repositories.
How can I achieve that ?
git
won't do this on it's own - by design. Not sure aboutgitolite
, as I'm not familiar with it.One way you could accomplish this would be by distributing a custom clone script that runs
git clone
and then creates/copies the hook scripts into the proper location, possibly getting them from the repository itself, or from a HTTP or FTP server, or hard-coding the hook contents in the script.