Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TFS/Visual Studio: Move file in the solution without doing an "add-remove"

We recently had to do some refactoring, implicating that we had too move some files.

So in one branch, we did all thoses changes. In the trunk, we continued to work normally, but it appears that when merging, it causes a lot of troubles, since the files appears as removed on the old position and added to the new, making the merge very hard.

What is the correct way to proceed when moving file in the solution?

like image 202
J4N Avatar asked Aug 05 '15 07:08

J4N


1 Answers

If you move a file inside a Project that is "bound" to source control, it should be recognised as a "Move" operation, and not do an Add/Delete. If the project isn't bound it might not work correctly.

If you are moving files between projects, you have to unload the Project/Solution and move the files in Source Control Explorer. This can be a bit tedious as you can only move one file/folder at a time*. Then you have to reload the projects and Exclude the files from the old one and Include them into the new one.

*There is an extension that allows you to move more than one file at one called TFS Source Control Explorer Extension.

like image 171
DaveShaw Avatar answered Sep 18 '22 01:09

DaveShaw