SVN: Checkout/export only the directory structure

petr k. picture petr k. · Feb 11, 2009 · Viewed 25.9k times · Source

Is there a way to perform a SVN checkout (or export), which would fetch only the directory structure; that is to say, no files?

Answer

Dave Stenglein picture Dave Stenglein · Feb 11, 2009
svn ls -R {svnrepo} | grep "/$" | xargs -n 1 mkdir -p

Export, not a checkout.

[Updated]

With checkout:

env REPO={repo} sh -c 'svn ls -R $REPO | grep "/\$" | xargs -n 1 svn co --depth=empty $REPO'

This will be pretty slow for anything too large.