How can I check out just the trunks of multiple projects from the same repository?

Short answer: no.

Long answer: See http://svnbook.red-bean.com/en/1.5/svn.advanced.sparsedirs.html and do your checkouts in a looped script.


You can use the -N option, which ignores subdirectories. You can run this the very first time you check out the sources:

svn co -N http://path/to/repo
cd repo
for f in Project1 Project2 Project3; do
  svn up -N $f
  svn up $f/trunk
done

And to update the trunks at a later time:

svn up repo/*/trunk

This works with all SVN clients. If you're using an SVN 1.5.x client, you can also have a look at "sparse directories", documented at Sparse Directories (I'm not allowed to post links yet :-C), which will allow you to run "svn update" in the repository directory.


This did the trick nicely in bash. Note that I renamed the output folders to make Eclipse happier when importing the projects.

for f in `svn ls http://path/to/repo`; do svn checkout http://path/to/repo/${f}trunk $f; done

Tags:

Svn