Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Team Foundation Server merge not merging

Why does TFS not want to give me my old files back?

Dev Branch enter image description here

Main Branch enter image description here

Merging Dev to Main enter image description here

Edit: Given the first answer below and some more investigation, I believe I am trying to accomplish an entire branch overwrite. Is this possible?

like image 377
Terry Avatar asked Oct 09 '22 07:10

Terry


1 Answers

This is a good one, I think the best thing to do would be to undelete the files and folders in the Main branch. To do this go in to "Tools", "options". The expand "Source Control", Select "Visual Studio Team Foundation Server" and check "Show deleted items in the Source Control Explorer"

enter image description here

This will allow you to select the deleted files and use the "undelete" command to get them back.

However if you really want to push the changes from your dev branch to the main branch then you might be able to use the command line to force TFS to do the merge.

Open a Visual Studio 2010 command prompt and navigate to your workspace

e.g. cd c:\tfs\MyLocalWorkspace

Then use the "tf" command

tf merge $/TeamProject/Dev $/TeamProject/Main /recursive /force

This will force TFS to merge the changes even if it thinks they've been merged before. I would probably say that using "undelete" is the least likely method to cause "wierd stuff" from happening in the future.

like image 112
James Reed Avatar answered Oct 13 '22 11:10

James Reed