Search code examples
gittemplatesgitignoregitolite

Gitolite gitignore template


We are in the infancy of switching our source control environment over to Git with Gitolite for access control.

The one thing that I would like to know if it's possible and how, would be to create a default .gitignore that would be included in all new repos created with gitolite by default.

There are a number of project files (ie. eclipse meta files) that need to be excluded from every project that it would be nice to identify them and include it in a gitignore right out of the get go.

Is something like this possible?

Thanks in advance!


Solution

  • Yes this is absolutely possible. Check Using Hooks and scroll up a bit to "gl-post-init" hook. There you can create a hook that is run each time a repository is created and you could copy in a default .gitignore, and commit it to the repository as the first commit.