Git hook to prevent top-level directory creation

Any better way to prevent users from creating a top-level directory of a top-level directory by clicking or directly creating a file?

+3
source share
3 answers

This answer complements VonC 's answer .


Since each developer should have his own clone (his own working repository), the only control that you can really impose on 1 is to enable or disable during repository push-posting (or during you pull their changes). This can be done using updateor pre-receive hook .

1) The hook pre-commitcan be bypassed with git commit --no-verify "

, - , , , update-paranoid ( contrib/hooks git ) gitolite ( git) ; /diff, , .

+2

,

pre-commit , .
, , , - , , , . , git commit --no-verify.

. , , .

+1

, , . , , .

+1

Source: https://habr.com/ru/post/1756503/


All Articles