I want to create specific set of branches off of master during initial set up and prevent them from being deleted or any new branch from being created off of master. Any new branches created or deleted after that will be done off of those branches that were made during setup. Is there a way to do this? Git hooks or something else? I would like it where if git branch -d < branch-to-protect > is run then I want it to be prevented from deletion and possibly echo a message to the screen. Also, if git branch < any-new-branch > or git branch master < any-new-branch > or git checkout -b < any-new-branch> is run then check if it would be coming off of master; and, if so, stop it and possible echo a message to the screen.
Example:
Suppose I create branches “Development” and “Staging” directly off of master during initial setup. After this I do not want allow any other branch to exist directly off of master, only off of Development or Staging only. I also do not want Development or Staging to be able to delete it.
Thanks in advance if any help