This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This pre-commit hook prevents commits on branch '<forbidden_branch>' and enforces the use of feature branches. | |
# To use it in your repository, follow these steps: | |
# 1. Copy this file to `.git/hooks/pre-commit` | |
# 2. Make the file executable, e.g. via `chmod u+x .git/hooks/pre-commit` | |
# | |
# If one wants to commit to the '<forbidden_branch>' branch, the commit is rejected (script exits 1). | |
# The user is asked to create and checkout a new feature branch in order to proceed with the commit. | |
# |