21
votes

How do I "un-checkout" a subfolder using TortoiseSVN?


What have I tried:

The first two options seemed to work at first, but when I hit Check for modifications on the top-level folder it would tell me the subfolder and its contents were "missing". This is of course not what I want.

To make things clearer, the relevant bit of my folder structure is similar to this:

//Repository/trunk/...
//Repository/branches
                     /some-feature-branch1/...
                     /some-feature-branch2/...
                     /some-feature-branch3/...
                     /some-feature-branch4/...
                     etc.

In the past I've done the following:

  • Check out the //Repository/branches folder locally, without recursively grabbing the content.
  • Made individual check-outs of some (but not all) feature branch subfolders

I'm trying to remove -say- some-feature-branch3 from my local disk, but this always leads to status "missing" for the subfolder, when checking the "branches" folder for modifications.

Note that I'd prefer a way to fix this using TortoiseSVN, but if it isn't possible a command-line fix would be an acceptable alternative.

2

2 Answers

39
votes

In SVN 1.7 you can do svn up --set-depth exclude some-feature-branch3 (not sure if you can do it in SVN 1.6).

In Tortoise you can right click on some-feature-branch3 -> 'Update to Revision' -> 'Update Depth: Exclude' -> 'Make Depth Sticky'.

If you can't do it in 1.6 you can do the same trick only with depth empty. It will leave the directory itself, but it will be empty which is enough for most practical purposes.

21
votes

Right click the folder and go to "Update to revision...". In the dialog that pops up, set the Update Depth to "Exclude". (Note, this only seems to work for folders.) That will remove it from your working copy, but won't affect the repository. Tortoise will just know not to try and update it during updates.

In order to undo it, you can right-click the parent folder (or its parent, and so on) and pick "Repo Browser". Find the excluded folder, right-click and pick "Update item to revision". You'll get that same dialog; this time, just make sure it says "Working copy".