Azure-devops-docs: Lock does not prevent commits

Created on 25 Dec 2018  Â·  3Comments  Â·  Source: MicrosoftDocs/azure-devops-docs

I just tried this out. Created a branch and locked master. I did a PR from the new branch back in to master. No problem. I did a change on master and pushed directly in to master. No good. Does the lock not lock out the person who put up the lock? I'll have to test when my team is back, but I would prefer this not be the case (you know in case I forget and push to master...).


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Pri2 devopprod doc-bug

Most helpful comment

@Naphier I can check but I believe when you lock a branch, it is locked for others but not for you.

If you are talking about master branch, can you use branch policies which would disable pushing directly to master, and ensure that your team doesn't have Bypass policies when pushing permission which would allow them to override that policy? (By default, contributors group does not have this). Enabling any branch policy on master would prevent direct pushes to master. More info on branch policies: https://docs.microsoft.com/en-us/azure/devops/repos/git/branch-policies?view=vsts

All 3 comments

@Naphier I can check but I believe when you lock a branch, it is locked for others but not for you.

If you are talking about master branch, can you use branch policies which would disable pushing directly to master, and ensure that your team doesn't have Bypass policies when pushing permission which would allow them to override that policy? (By default, contributors group does not have this). Enabling any branch policy on master would prevent direct pushes to master. More info on branch policies: https://docs.microsoft.com/en-us/azure/devops/repos/git/branch-policies?view=vsts

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@steved0x - Could you please add this clarification in the document as well? I just encountered this same issue and this is not documented.

/reopen

Was this page helpful?
0 / 5 - 0 ratings