views:

155

answers:

2

We have a baseline folder and development branches in TFS. We'd like to add a policy where changes can only be merged into the baseline from a development branch and not edited directly unless you override the policy. How can we do this?

A: 

You might consider limiting the security on those branches to the person(s) who would be responsible enough to do it right.

Chris Lively
I noticed the "Change" column in the Check In window has the word "merge", not "edit" when I merge back to the baseline. Are you saying a policy can't check this value?
adam0101
A merge is sometimes an edit, but not always. An edit is sometimes a merge, but not always. One does not imply the other.
Richard Berg
I gave some bad information and just updated accordingly.
Chris Lively
+2  A: 

There is no way to enforce this restriction 100%. Options:

  • write a checkin policy [but they can be overridden]
  • write an event hook that notifies you [or takes some other action] when someone commits something that wasn't a merge
  • restrict checkin permissions on the branch to trusted developers / integration managers [but they themselves would have full rights]

There's an example of a "merge only" checkin policy here: http://leon.mvps.org/Tfs/MergeOnlyPolicy.html

Richard Berg