Is it possible to create a Git hook that would prevent creating a brach name not meeting some specific requirements?
Say I want to allow only branch names composed with [-a-z/]
(small letters, /
and -
, i.e. disallow capital letters).
Commit or post hooks are not good enough because someone can do:
git checkout develop
git checkout -b feature/WrongBranchName
Sure, in this case I can prevent pushing such branch to remote or adding new commits to it, but the branch has already been created.