Question

Is there a way to override a branch in TFS 2008 with the content of its parent? I've tried a merge (but no way to specify a complete refresh in the UI) but i am unsure because i would like to completely refresh the entire branch.

any thoughts on that?

Was it helpful?

Solution

If you want to synchronise the branches so that the child branch is identical to the parent, I'd just take a new branch from the parent. This is the easiest way to make sure that they are completely the same. You can then delete \ archive the old child branch.

If you merge from the Parent to Child TFS will check all the files in the branch and the following rules apply

  1. If a file has been modified in the parent, but not in the child (since the child branch was created) then the file from the parent will overwrite the file in the child.
  2. If a file in the child has been modified, but not in the parent (Since the child branch was created) then the file in the child will not be overwritten
  3. If a file has been modified in both the child and the parent (since the child branch was created) then TFS will bring up the conflict resolution tab and you will be given the option to keep either version of the file, or to merge the files creating a 3rd version that contains a combination of the changes.

In the conflict resolution tab you can select all files and choose to keep the version from the parent. However any files modified only in the child will not be overwritten (see point 2)

You could also use the command line option

tf merge $/Project/Parent $/Project/Child /force /recursive

This will tell TFS to attempt to merge files that it already thinks have been merged to the file. I still don't think it will merge files that haven't changed since the child was created though.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top