Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Undo check out of subfolder in TortoiseSVN

Tags:


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


What have I tried:

  • Delete the entire subfolder
  • Export-in-place, i.e. exporting the folder on top of itself
  • Search SO for things like undo+svn+checkout
  • Peek inside the hidden .svn folders to see if I could manually edit things

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.

like image 435
Jeroen Avatar asked Jun 04 '12 10:06

Jeroen


People also ask

How do I undo checkout in TortoiseSVN?

If you want to undo all changes you made in a file since the last update you need to select the file, right click to pop up the context menu and then select the command TortoiseSVN → Revert A dialog will pop up showing you the files that you've changed and can revert. Select those you want to revert and click on OK.

What does check out mean in SVN?

svn checkout checks out (retrieves) a working copy of the repository into the specified folder. If you don't have access to the repository, and there's not already a current copy of the source in the folder, you can't possibly do a build.


Video Answer


2 Answers

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.

like image 111
malenkiy_scot Avatar answered Sep 23 '22 02:09

malenkiy_scot


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".

like image 34
cHao Avatar answered Sep 22 '22 02:09

cHao