On Friday, January 31, 2014 8:25:00 AM UTC+1, Philipp Kraus wrote:
>
> Hello,
>
> can I define on my server repository, that the ignored file patterns are 
> hard defined. My problem is, that each use can modify the gitignore, but I 
> get with this modification
> files into the server repo, which should not be there, so I would like to 
> define in the server (bare) repo files patterns, which should be never 
> pushed into the repo. I would like to do this with a hook, check the pushed 
> filelist and reject the push, if some filepattern is found
>
> Is this the correct way or is there a better solution?
>

I think the best way is to keep a clear and well-made .gitignore file, and 
foster a culture that respects not changing it without good reason. Hard 
constraints on contributors are usually counter-productive in the long run.

However, you can make pre-receive hooks in repositories that reject pushes 
based on anything you can express in a script. Example: 
http://stackoverflow.com/questions/2569960/git-pre-receive-hook

-- 
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