Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SVN: Checkout/export only the directory structure

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

like image 736
petr k. Avatar asked Feb 11 '09 15:02

petr k.


People also ask

How do I export a directory from svn?

Another way to export from a working copy is to right drag the working copy folder to another location and choose Context Menu → SVN Export versioned items here or Context Menu → SVN Export all items here or Context Menu → SVN Export changed items here. The second option includes the unversioned files as well.

What is the difference between svn checkout and export?

svn export simply extracts all the files from a revision and does not allow revision control on it. It also does not litter each directory with . svn directories. svn checkout allows you to use version control in the directory made, e.g. your standard commands such as svn update and svn commit .

How do I check a directory in svn?

Check out files from Subversion repositoryIn the Get from Version Control dialog, click Add Repository Location and specify the repository URL. Click Check Out. In the dialog that opens, specify the destination directory where the local copy of the repository files will be created, and click OK.


1 Answers

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.

like image 172
Dave Stenglein Avatar answered Oct 05 '22 23:10

Dave Stenglein