[ACCEPTED]-Making a TFS Branch Read-Only-branch

Accepted answer
Score: 51

Right-click the branch in the Source Control 9 Explorer, and select the Lock... option

EDIT: This 8 seems to get missed a lot when people are 7 finding this so I'll make it more obvious.

Locks appear as a "pending change" for the person who locked the item. As long as the lock is in effect, it will appear as a pending change. When a commit is made of that pending change, the lock is released. While 6 the lock is in effect, the locked branch 5 is effectively read-only, since (to simplify) the 4 locker is the only user who can make commits. The 3 act of committing is what releases any locks 2 on the branch.

h/t @AakashM for pointing 1 that out in the comments

Score: 11

As a quick-n-dirty, you could Lock it for 4 Check Out (although the locker would have 3 to remember to keep the lock in their pending 2 changes forever... which makes me think 1 there's a better way)

Score: 9

To answer the 2nd part of the question -- removing 2 or denying the Read permission effectively 1 denies everything else.

Score: 5

As is mentioned above locking is not a very 6 nice strategy. The correct way of handling 5 this is setting permissions.

You can effectively 4 make files readonly. Users trying to modify 3 the files will get a message 'checkout denied'


In 2 VS2013: Team Explorer -> Settings -> Security/Version 1 Control

Score: 3

Deny Check In for domain\domain users


Score: 2

If you have inheritance set to 'On', the 4 best way I've found is to:

  1. 'Deny' all permissions except 'Read' to the 'Reader' group, and
  2. Add all other groups (except Project Administrators) to the 'Reader' group.

Then, all groups 3 within the Reader group will inherit the 2 'Deny' permissions and not be able to do 1 anything but read.

More Related questions