TFS: How to force a merge between certain files or folders

by zebsadiq 5. February 2014 00:11

I encountered a weird situation where my source branch had some changes which I wanted to propagate to the target branch via merge in Team Foundation Server. However these differences were not being picked up by the merge process, resulting in no files being checked out for a merge.

I found a way of forcing TFS to merging changes between two items. You can do this via the Visual Studio command prompt by using the tf tool. Here is an example:

tf merge $/MyProject/DevBranch/MyFile.txt $/MyProject/ReleaseBranch/MyFile.txt /force /Version:T

 

Please note that:

  • /Version:T means, get the latest version. You can also get the code from a label (or by other means).
  • /Recursive could be added if you want all files inside a folder to be forced to merge.

In my situation, I had to revert release branch back to an earlier version of the code which may have confused TFS. I suspect I won’t be the only one who will come across this. Luckily for me, I only had to perform this command on two files.

Tags:

Team Foundation Server

Comments

Add comment




  Country flag

biuquote
  • Comment
  • Preview
Loading



Calendar

<<  May 2017  >>
MoTuWeThFrSaSu
24252627282930
1234567
891011121314
15161718192021
22232425262728
2930311234

View posts in large calendar