views:

1300

answers:

5

Hi.

I'm using subversion and Visual Studio 2008 (and Tortoise)

I've got a number of folders in visual studio projects that I want to rename.

Whenever I've tried this in the past I've ended up with conflicts and had to create my new folder, copy all the existing content in to it, check it in and delete the old folder.

Has anyone come across a more straightforward way to do this, or have a set reliable process for renaming folders in Visual studio and Subversion?

thanks in advance,

Chris.

A: 

Tortoise SVN has a rename feature built right in. Right click the folder, click Tortoise SVN, click Rename. You'll of course have to check in your change.

colithium
A: 

Using VisualSVN, I can just change the folder name in Visual Studio.

Without it, I have to remove the folders from the project in VS, SVN Rename the folders via Tortoise, and then readd the newly renamed folders to the VS project.

codekaizen
+1  A: 

There are two solutions. The first one:

  1. You right click on the folder in in Visual Studio, and pick "Exclude from project"
  2. You rename the directory with Subversion / TortoiseSVN / whatever (of course, you have to rename the folder with the rename command of a subversion client, otherwise you will end up in trouble)
  3. You add the folder to the in Visual Studio project again

Second approach: You download some SVN plugin for Visual Studio such as VisualSVN or AnkhSVN and use them to rename the folder safely in Visual Studio.

DrJokepu
A: 

Using TortoiseSVN right-click on folder you want to move and while holding button down drag to new location. TortoiseSVN will then show you a menu with options....that should do it :-)

Cheers

Mike

ozczecho
He's not looking to move or copy a folder, but rename. Tortoise SVN has a rename command, but it's not on a right-click drag menu. This advice is incorrect.
Ali Parr
No, it's not. "svn rename" is a synonym for "svn move".
Rytmis
... although this advice does make the rename feel a bit unnatural. :)
Rytmis
+12  A: 

TortoiseSVN has a feature to help with moves and renames performed outside SVN, after the fact.

Rename the folder as you would normally. Then right-click the root folder and select TortoiseSVN -> Check for modifications. In that list you'll see "oldfoldername missing" and "newfoldername unversioned". Ctrl-click on both of them, then right-click and select "repair move".

This way, you can rename folders and files with the benefit of VS's refactoring tools, but without messing up SVN.

Rytmis
Fantastic - didn't realise this. +1 !
Ali Parr
I was pretty pleased with it too. :)
Rytmis
Just as a note, I usually find its best not to rename more than one folder under the same root, without doing a 'repair move' and 'commit' in between.
cbp
If I could vote this up twice I would
Gilligan
You've saved my life!
Darius
Here is a link on the subject: http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-rename.html
CRice