Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to version git&gitolite hooks?

Is there a possibility to nicely version and track git hooks? Can I safely have another (nested) git repository under the hook folder on server?

like image 793
Olha Puzhay Avatar asked Nov 13 '22 10:11

Olha Puzhay


1 Answers

Nothing prevents you to add your gitolite server hooks to a admin repo (or even the gitolite admin repo, where you are adding public ssh keys and the config file for all the repos and associated rights).

However pushing that admin repo back to the gitolite server won't trigger anything hook-wise.
You will still have to go to the hook folder on the server and:

  • have a hook which will checkout the content of that admin repo
  • make symlinks from each of the hooks in your server folder to the one versioned to your (checked out) admin repo.

It seems clearer to have a dedicated repo for server hooks (itself declared in Gitolite), instead of burying a Git repo within a technical folder of Gitolite.

like image 146
VonC Avatar answered Nov 15 '22 23:11

VonC