I have an idea of locking a repository from users pushing files into it by having a lock script in the GIT update hook since the push can only recognize the userid as arguments and not the branches. So i can lock the entire repo which is just locking a directory.
Is there a way to lock a specific branch in GIT?
Or is there a way an Update Hook can identify from which branch the user is pushing and to which branch the code is pushed?
The branch being pushed to is the first parameter to the update hook. If you want to lock the branch
myfeaturefor pushing, this code (placed inhooks/update) will do it: