Removing .svn folders from a working copy with TortoiseSVN

Posted on Tuesday 23 September 2008

On Stefan’s blog on TortoiseSVN, he describes a trick that can be used to “unversion” an svn working copy — basically, how to remove all the .svn folders from a working copy.  This is something that I do, periodically, so it’s nice to learn a new shortcut — and, I love shortcuts.

I figured that I would re-present the information here, for LabVIEW users, but try to simplify the instructions, a little bit.

To do this trick, you basically export the working copy onto itself — meaning, you choose the working copy’s location as your checkout destination (so that the export source and destination are the same).  TortoiseSVN is smart about this and realizes what your trying to do, and it simply removes all the .svn folders from your working copy.

You can do this trick, one of two ways:

Method 1) Right click on your working copy and choose TortoiseSVN>>Export.  In the resulting file dialog, browse to the working copy folder, select it, and choose OK.

Method 2) You can use the TortoiseSVN Right-Click Drag and Drop feature, using the technique shown in the screenshot below.  First, make sure to select “Folders” to view the explorer tree.  Second, use the File Explorer tree to select the working copy’s parent folder in the tree (Folders area to the left), so that the working copy folder is visible in tree and in the file list (area on the right).  Third, right-click drag & drop your working copy from the file list (on the right) onto itself in the tree (on the left).  Then, when the pop-up list of choices appears choose “SVN Export versioned items here”.

Method 1 is a little bit harder, IMO, since the file dialog is one of those awful Browse for Folder (explorer) dialogs (which I don’t like), instead of a standard File Dialog that you can use to paste in a path (which I prefer).  But, Method 2 is trickier to understand, but hopefully the annotated screenshot, above, helps.

Do you know any other useful TortoiseSVN tips?  Please leave a comment and share them.

Using Subversion in LabVIEW? The JKI TortoiseSVN Tool for LabVIEW makes it easy by letting you use TortoiseSVN from inside your LabVIEW Projects and VIs.

Subversion and LabVIEW in the Enterprise : If your organization uses LabVIEW and you would like help deploying Subversion in your organization, consider hiring JKI to help get you started. You can contact us via our website.


8 Comments for 'Removing .svn folders from a working copy with TortoiseSVN'

  1.  
    Sam
    September 23, 2008 | 8:47 am
     

    Hi Jim, I just search for “svn” in the explorer and then only delete the “svn folders”.

  2.  
    September 23, 2008 | 9:07 am
     

    Hi Sam, Thanks for the tip. Actually, I typically use the explorer search technique, too. One of the problems with this approach, however, is that “.svn” folders are “hidden” folders and the explorer search does not include hidden files or folders, by default — you have to make sure to reconfigure the explorer search to include them.

  3.  
    September 23, 2008 | 11:02 am
     

    This is awesome. This just saved me a huge headache. Thanks!

  4.  
    Yonatan Tidhar
    September 24, 2008 | 9:43 pm
     

    Hi Jim
    Thanx to you for shring us your experiance.
    one comment – I check it iwith Tortiose 1.4.8 and it didnt work. 1.5.3 work as you described

  5.  
    September 24, 2008 | 10:10 pm
     

    Josh: Glad that it helped you.

    Yonatan: Thanks for the info. This sounds like a great reason for everyone using 1.4.x to upgrade!

  6.  
    David Fackler
    November 19, 2008 | 12:06 pm
     

    Variation for the command-line happy.
    Aim carefully.

    Using GNU or Cygwin tools:

    find . -type d -name ‘.svn’ -exec rm -rf {} \;

    Using Windows native tools:

    for /f “usebackq” %x in (`dir /s/b/ad .svn`) do rmdir /s/q %x

  7.  
    November 19, 2008 | 2:18 pm
     

    David: Thanks for the tip.

  8.  
    September 1, 2017 | 3:22 am
     

    Hmm it seems like your site ate my first comment (it was extremely long) so I guess I’ll just sum it uup
    what I had written andd say, I’m thoroughly enjoying your blog.
    I as wwell am an aspiring blog blogger but I’m still new to everything.

    Do you have any tips and hints for roookie blog writers?
    I’d genuinely appreciate it.

Leave a comment

(required)

(required)


Information for comment users
Line and paragraph breaks are implemented automatically. Your e-mail address is never displayed. Please consider what you're posting.

Use the buttons below to customise your comment.


RSS feed for comments on this post |

 

Bad Behavior has blocked 778 access attempts in the last 7 days.