Friday, March 31, 2017

SVN - how to transform individually checked-out sub-folders into sparse checkout

Leave a Comment

SVN repo looks like this:

top/
top/one
top/two
top/three
...etc

You don't want to checkout the entire top folder but you don't know about SVN's sparse checkout feature.
So you check-out repo folder top/one into C:\svn\top\one and then you checkout repo folder top/two into C:\svn\top\two

At this point, both of the checked-out folders have their own .svn folder

Then you discover sparse checkouts.

QUESTION

How do you transform the "standalone" checkout of these two folders into a sparse checkout of the top-level folder with minimal re-checking out?

Is it as simple as initiating a sparse check-out while not overwriting existing items and then simply deleting the pre-existing .svn folders?

1 Answers

Answers 1

SVN works recursively, which means that every folder is mostly independent from its parent. So the issue comes from the .SVN in the parent folder, this is the one you want to recreate from scratch.

Rename your former folder (.old) and create a new one. Do your Sparse Checkout in that folder. It should download the files but you can prevent that with --depth empty.

Then, move your old folders back in the freshly created Sparse Checkout folder and Clean it. SVN will scan and repair the folder recursively.

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment