Some out-of-the-box hooks for pre-push.
See also: https://github.com/clumio-oss/pre-commit
Add this to your .pre-commit-config.yaml
- repo: https://github.com/clumio-code/pre-push-hooks
rev: v1.0.0 # use the release tag from github
hooks:
- id: check-branch-for-push
args: ['--pattern', '^testbranch.*']
...
Protect specific branches from direct checkins.
-p
/--pattern
can be used to protect branches that match a supplied regex (e.g.--pattern, release/.*
). May be specified multiple times.