Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Renaming files: Visual Studio vs Version control

The problem with renaming files is that if you want to take advantage of Visual Studio refactoring, you really need to do it from inside Visual Studio.

But most (not all*) version control system also want to be the ones doing the renaming.

One solution is to use integrated source control, but this is not always available, and in some cases is pretty clunky.

I'd personally be more comfortable using source control separately, outside of Visual Studio, but I'm not sure how to manage this question of file renames.

So, for those of you that use Visual Studio, which source control do you use? Do you use a VS integration (which one?) and otherwise, how do you resolve this renaming problem?

(* git is smart enough to work it out for itself)

like image 761
Benjol Avatar asked Apr 07 '10 13:04

Benjol


2 Answers

I use SVN (TortiseSVN as the client) and use the Repair Move command from the commit dialog heavily. This allows me to rename the files within VS and resolve the rename when I'm ready to commit to keep version history.

As far as using the VS integration, like you, I find all VS integration clunky and do not use it.

like image 99
Aaron Carlson Avatar answered Oct 02 '22 15:10

Aaron Carlson


mercurial usually prefers to do the renaming via hg rename however it can also detect renames from an outside source by using hg addremove -s 100 (or less than 100 if you want to match a rename with alterations) so clearly you can let VS do the rename and get mercurial to catchup with addremove.

like image 43
jk. Avatar answered Oct 02 '22 16:10

jk.