How to block odt file on GIT?
1 answer
Write a pre-receive hook that checks for incoming presses, here is a basic full control loop:
path=path/to/protected/file
while read old new ref; do # for each pushed ref
git rev-list $old..$new \
| while read; do # check for bad commits
# test here, e.g.
test "`git rev-parse $REPLY:$path`" \
= "`git rev-parse v1.0:$path`" \
|| {
echo "** altered $path in $ref@$REPLY **"
exit 1
}
# end of this test
done
done
Now no one can push the modified version to your repo.
+1
source to share