Tuesday, February 21, 2012

Tortoise SVN Sparse Directories

So I had checked out this project from SVN and with it came a dozen or so release branches I wasn't going to need. Now since these release branches were subfolders of the main project, they didn't have individual .svn folders to delete. Thus Tortoise SVN exporting wouldn't work either.  And just deleting the folders outright meant I was only one thoughtless commit away from removing them from the repository all together.

I needed some way to remove them from my local system without indicating to Tortoise SVN that I wanted to delete them from source control.  Enter the sparse directory update (src1, src2, src3).

From the Tortoise SVN context menu for a given folder, select "Update to revision". Set "Update Depth" to "Exclude", and use "Choose items" to select the folders you want to keep. Verify "Make depth sticky" is selected so you won't have to repeat this process after every code update. After a minute or two of SVN doing its thing, you'll have all of the folders you want and none that you don't.

No comments:

Post a Comment