Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TFS version control - File deleted, added - how do we tell TFS it was a move?

We are doing some major refactoring and in the course of that we are moving a lot of files. We use ReSharper which makes this (relatively) painless as it updates all uses everywhere when we move files - even to a different project. So everything is great.

Except we just discovered today that ReSharper would tell TFS to delete the file in the old location and then insert as a new file in the new location. How can we tell TFS that this delete/insert was actually a move?

like image 987
David Thielen Avatar asked Aug 25 '11 19:08

David Thielen


1 Answers

I faced a similar situation where I wanted to move files between projects and I wanted to have Resharper do as much work as possible. Here are the steps I ended up doing:

  1. Move the file in Resharper. This will make the appropriate change to the target project file.
  2. Close the solution or disable Resharper.
  3. Undo the delete/add in TFS.
  4. Move the file in TFS.
  5. Make sure that the moved file is no longer in the source project.
  6. Reload the solution or re-enable Resharper.
  7. Use Resharper to make any namespace changes.

Obviously one can do it with more than one file at a time. It's a pain, but TFS ends up with the right change, and Resharper takes care of changing references.

like image 54
Bernard Chen Avatar answered Oct 18 '22 01:10

Bernard Chen