Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This is on Win2k3sp2, using TortoiseSVN 1.6.5 and SlikSVN 1.6.3.

I have a folder in a repo, call it /a/b, which I want to become /a/c/d in the same repo. I have tried just moving the folder and renaming it, and then committing, and apparently it gets confused, because the .svn folder thinks it's still under the old name, and if it does work, it's a two-commit thing where /a/b is deleted and /a/c/d is brand new, which is no good, because then I lose the history attached to each file.

I started poking around and found "relocate," which comes with a huge warning and convinces me not to use it. Then there's "switch," which, although I thought "relocate" was a more intuitive way of describing what I wanted to do, seemed to be the appropriate option. So I did that, and it took a long time, even though there were only a few files within /a/b (like maybe 8 folders, each containing a file or two), and now:

  1. /a/b is still there
  2. half the folders in /a/b are gone
  3. the remaining folders in /a/b give me an error when I try to look inside them: "/a/b/e is not accessible. Access is denied."
  4. /a/c/b (not /a/c/d as I had told it!) was created but stayed empty
  5. I tried an update and now some folders are back in /a/b, but not all

My question then is in two parts:

  1. How do I clean this up?
  2. What's the proper way to move a folder as I described?
share|improve this question
up vote 5 down vote accepted

Your problem is having used the wrong command; 'Switch' does the exact complement of what you wanted - it changes the repository location your working copy 'points at', without changing the repository. (Switch then commit would have produced some result, but in a really broken way which isn't what you meant. You were right; the tempting-sounding 'Relocate' is a special case of 'Switch', and should be avoided for the same reason.)
The 'Update' command then updated the working copy to match what was currently in the repository at the 'new' location - nothing!

Subversion doesn't have a true move/rename yet. The subversion-safe way to do it is to copy and then delete. TortoiseSVN includes a handy 'move' option which does a copy-and-delete as one operation.

The easiest way to do what you wanted:
1. Open repo-browser in TortoiseSVN.
2. Right-click and drag the folder from its old location to the new one.
3. Select 'Move' from the context menu.

This also works inside your working copy, and is the safe Tortoise/Subversion way to move or rename files and folders in the wc without losing history.

share|improve this answer lose history either way? Is that true of CVS and git? I feel like I do this operation often enough... – Kev Oct 23 '09 at 15:05
Oh, wait, it seems to keep the history okay, it's just hidden by default on the Show Log screen. – Kev Oct 23 '09 at 15:10

to answer your second point, here's how I move folders with Tortoise-SVN:

  • right click in Windows explorer on a folder, then 'Tortoise SVN', then 'Repo-browser'.
  • in repo browser, make your you are looking at where-the-folder-you-want-to-move-is.
  • click on the folder (or file!) to move and drag it on the left pane where you want it to be
  • click OK to close the repo browser
  • right-click in your folder and 'Update'.

When you update, Tortoise SVN will delete the folder where it was and re-create it where you moved it.

share|improve this answer

To move the files properly, use the move command.

Note, move, mv, rename, ren are aliases for the same command. It can be found in TortoiseSVN under "TortoiseSVN" -> "Rename..." see here

share|improve this answer
+1 for being true, although the reason I never found it was that it's not in the TortoiseSVN context menu. – Kev Oct 23 '09 at 15:11
@Kev: Check my answer again, I edited it. Move can be found under rename. – Tim Büthe Oct 28 '09 at 8:51

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.