Last Updated: February 25, 2016
· k4ml

Subversion shallow checkout

Usecase - we want to work on branch 155-new-dashboard and trunk only. Checking out the root repository will give us the whole repo with all the branches and tags. For a big repository, this will take sometime. To do shallow checkout, subversion provide the --depth options to the checkout command.

svn co --depth immediates
ls repo
branches tags trunk
# at this point all directories are empty
svn up branches/155-new-dashboard
cd trunk
svn up --set-depth infinity
The catch is the last step. Simply doing svn up in trunk won't checkout anything. Fortunately,   subversion allow setting up --depth in each sub-directory.