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.