I’m trying to setup a git hook that will disallow anyone to delete the master, alpha, and beta branches of our repository. Can anyone help with this? I have never done a git hook, so I don’t want to try my luck in developing my own without a little help.
I’m trying to setup a git hook that will disallow anyone to delete the
Share
Straightforward with a
pre-receivehook. Assuming you’re using a bare central repository, place the following code inyour-repo.git/hooks/pre-receive, and don’t forget tochmod +x your-repo.git/hooks/pre-receive.