Lock a git branch
The branch being pushed to is the first parameter to the update hook. If you want to lock the branch myfeature
for pushing, this code (placed in hooks/update
) will do it:
#!/bin/sh
# lock the myfeature branch for pushing
refname="$1"
if [[ $refname == "refs/heads/myfeature" ]]
then
echo
…
Top comments (1)
Technically No,
because that is something should be done using a external software using github/gitlab
using hooks my sound good idea but only if you keep those hooks in your pc.