Can't find an answer to my exact question. We migrated to a different source control system and want to keep a read-only snapshot of the entire repository. No one should be able to commit any changes anywhere. Is there a way to do this?
As @jpierson already answered, you can use authz files to define No Access, Read Only or Read Write rules on repository paths. Repository path can represent repository root and any path within repository. I.e. you can specify access rules not only subtrees (folders) but files as well.
You can create a hook to do this:
repository/hooks/pre-commit
#!/bin/sh echo "No more commit here - this is an archive branch" 1>&2 exit 1
Notes that log messages must be redirect to /dev/stderr (that's the meaning of the 1>&2).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With