> From: Gergely Polonkai <gerg...@polonkai.eu>

> I don't know of any method built into git, but how about denying commits
> that modify the .gitignore file(s)? This way your hook must only check if
> the commit has modifications to any files called .gitignore.

My understanding is that you can write such a hook, one that examines
the files that will be changed and rejects the commit if it will
change files with certain names.

It is useful to have such a hook even if there is no concern that
users will not intend to change the files, because occasionally one
changes a file that one did not intend to change.

Make sure that there is at least one user that will not be stopped by
the hook.  Otherwise, there is no way to change the hard-defined files
without disabling the hook entirely.


You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to