I was holding an introductory presentation on GIT when someone from the audience asked me how to lock a remote branch, preventing a push from someone else.
I understand why a person that has been using TFS wonders about it, but are there reasons why you would need to lock a remote repository in GIT? If so, which ones?
Locking a branch in TFS makes it read only (see "Making a TFS Branch Read-Only")
Git itself isn't able to make a branch read-only: if you have access to a git repo, you clone it all (with all its branch), and you can commit in any branch.
You can control what is pushed through:
That means you can put in place a policy (hook or gitolite) which will prevent the modified branch to be pushed to the upstream repo.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With