0

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 ?

Roberto Martelloni
  • 587
  • 1
  • 5
  • 17

1 Answers1

0

git won't do this on it's own - by design. Not sure about gitolite, 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.

twalberg
  • 59,951
  • 11
  • 89
  • 84