July 22, 2011

SVN Sparse Directories (partial checkouts)

SVN 1.5 introduces a feature called sparse directories (or shallow checkouts or partial checkouts) that allows you to easily check out a working copy or a portion of a working copy.

How do we do it? On the command prompt use the following commands:
# svn co --depth empty
# pushd
(Assume: foo is a folder in SVN. With the following command you will not get any leaf folders or files.)
# svn up --depth empty foo
(Assume: bar is a sub-folder in foo. With this you will get all from foo/bar)
#svn up foo/bar
(With the following command, you get the only the latest copies of the checked out folders from SVN)
# popd
# svn up
(You can also perform a SVN commit at this level)

Performing SVN checkout (co) for each and every folder you require from SVN is not the way to go, since you cannot do a global SVN update or a commit.



No comments: