Search code examples
gitolite

Including my own scripts in the admin-repo with gitolite


I have some scripts that I call from a common hook of gitolite, I want to manage them from the configuration directories of the admin-repo repository so I can modify them more easily and they will be versioned also.

I have tried by adding a new directory and by tracking it with git add, but it does not work as expected. Maybe gitolite has some way to do this but I have not found any information on how to do such a thing.


Solution

  • Note: the following is for Gitolite V3 or g3 only.

    You can add/manage them in their own directories, namely the "hooks/common" sub-directory if the gitolite-admin (create it if it doesn't exists).

    That directory will appear in your Gitolite server in ~/.gitolite/hooks/common, and if you define a LOCAL_CODE rc variable) pointing to it, it will be taken into account.
    You might need to follow the push of the gitolite-admin repo by a gitolite setup --hooks-only on the server though.