ChrisV
ChrisV

Reputation: 2223

Renaming folders in SVN and VS.Net

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.

Upvotes: 14

Views: 5037

Answers (5)

Rytmis
Rytmis

Reputation: 32047

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.

Upvotes: 33

ozczecho
ozczecho

Reputation: 8849

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

Upvotes: 0

Tamas Czinege
Tamas Czinege

Reputation: 121324

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.

Upvotes: 3

codekaizen
codekaizen

Reputation: 27419

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.

Upvotes: 0

colithium
colithium

Reputation: 10327

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.

Upvotes: 2

Related Questions