First time here? You are looking at the most recent posts. You may also want to check out older archives or the tag cloud. Please leave a comment, ask a question and consider subscribing to the latest posts via RSS. Thank you for visiting! (hide this)

Did you ever rename a file from inside Visual Studio? Did you ever move a file from one folder to another from inside Visual Studio? I think you did.

And what happened when you tried to commit your changes to a SVN repository with Tortoise SVN?

You probably got this:

Tortoise doesn't recognize the two files as one

Here I moved a file named MonitoringControllerTest.cs file from the root to the Controller folder: Tortoise SVN didn’t recognize the file as just moved, but instead it found a new file in the Controller folder, and a missing file in the root folder.

If you want Tortoise to understand “moves” you have to do it from the File Explorer, dragging the file to the destination folder with the secondary mouse button while holding the Shift key. But this is annoying because you always have to move back and forth between Visual Studio and Explorer.

A few days ago I found this feature, maybe I was the only one in the world not aware of it: Repair Move.

If, from inside the commit dialog, you select the two files that are supposed to be the same, and right click on them, you will find this new menu command: Repair Move.

Repair Move command in the contextual menu

When you click on it, Tortoise SVN will recognize the two files as a move operation instead of a new file and a delete, and the commit dialog will show it in the way it shows moved files (a delete and an added +).


The same command also fixes rename operations.

I don’t know since how long this feature is available, but if I had found it out before, this would have saved me quite a few time.

Another option would have been adding something like VisualSVN or AnkhSVN that will automatically marks moves (together with a lot of other things). But I don’t like the integrated SVN clients.

posted on Monday, January 11, 2010 12:16 PM

Comments on this entry:

# re: Tortoise SVN tip: Repair move

Left by Roberto Messora at 1/11/2010 12:48 PM

did you try AnkhSVN latest version? Now it looks like TFS integration, it really seems the SVN version of Team Explorer: quite same menu items and icons. I suggest take a try.
ah... let me say that you should take a look to Git version control and explore how it's far better than SVN.

# re: Tortoise SVN tip: Repair move

Left by Simone at 1/11/2010 12:56 PM

@Roberto: yeah, I'm using git for some opensource works (I also wrote a post about how to get started with it
But at work we are using SVN.

We are also using AnkhSVN, but I prefer the bare-metal Tortoise as I can use it also when I don't use Visual Studio, and I found that using both at the same time screws up things sometimes.

# re: Tortoise SVN tip: Repair move

Left by Doug Rohm at 1/11/2010 3:40 PM

VisualSVN uses TortoiseSVN under the covers to do all of the repository tasks you want from inside visual studio. I haven't had any issues with VisualSVN. I prefer it over AnkhSVN.

# re: Tortoise SVN tip: Repair move

Left by Bryan at 1/11/2010 5:40 PM

I personally like the VisualSVN client and server. It was super easy to install the server on my Windows Home Server box. I tried AnkhSVN and it didn't seem to work very well for me. That was months ago so I don't remember exactly what it was I didn't like.

# re: Tortoise SVN tip: Repair move

Left by Gamlor at 1/11/2010 6:32 PM

Wow, thanks for this tip. I had this issue a lot.
When I tried AnkhSVN the last time, it didn't like it. Mainly because I didn't recognise changes outside of Visual Studio. But maybe it's the time to give it another try.

# re: Tortoise SVN tip: Repair move

Left by Kirk at 1/11/2010 8:21 PM

While holding the _what_ key? :)

# re: Tortoise SVN tip: Repair move

Left by Haacked at 1/11/2010 10:29 PM

Very nice tip! I wish I had known about this sooner. ;)

# re: Tortoise SVN tip: Repair move

Left by Mitch Labrador at 1/11/2010 10:31 PM

I use VisualSVN and it handles this scenario nicely. It uses TSVN under the hood, which makes it all the more solid.

Awesome tool!!

# re: Tortoise SVN tip: Repair move

Left by enriquein at 1/12/2010 12:50 AM

I'm not sure if this has been in TSVN for a long time since we used to have the same problems at my last job about 1.5 years ago. It's great to know they provide a solution to one of subversion's shortcomings.

Comments have been closed on this topic.