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.
If you want to do a simple in-place rename of a file or folder, use Context Menu → Rename... Enter the new name for the item and you're done.
Right-click on the project name & click reload the project. Then rename the project name as highlighted below & save. It will automatically rename the . csproj file.
Visual Studio is not competent at renaming things. Open the project folder in any good text editor. Search-and-replace across the whole folder and replace and text occurrences of the old name with the new name. Sublime Text and Atom have a tree view where you can right click -> Search in folder.
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.
There are two solutions. The first one:
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With