Thursday, September 13, 2012

How to check out a project from SVN repository ignoring some directories

I recently was working on the project with number of directories that were not used to build the project but were quite large in size. The obvious choice to ignore them on the checkout, however it is not that easily achievable using SVN.
So, here is a remedy (step-by-step guide):

  1. Identify names of directories that should be omitted from the checkout.
  2. Start general checkout of the branch: svn co <branch URL> <directory name>
  3. Interrupt checkout as soon as it creates directory (directories) that should be omitted.
  4. Delete directory that should be omitted from the disk.
  5. Run svn cleanup
  6. Do a checkout of the directory to be omitted specifying empty depth: svn co <branch URL>/directory --depth empty
  7. Do this for each directory that should be omitted. Note, that these directories could be situated at any level in the source tree, but the checkout with the empty depth should be done then from the directory that holds the one that should be omitted.
On the very large project it might make sense to do it iteratively, by running the updates and interrupting it immediately after the directory in question is created either by checkout or by update.

No comments:

Post a Comment