Can I ignore a folder on svn checkout? I need to ignore DOCs folder on checkout at my build server.
edit: Ignore externals isn\'t an option. I have
No, ignore is only for adding files.
You can use sparse checkouts (if you use svn 1.5)
You could put the docs folder in an external repository and then use svn checkout --ignore-externals
.
This is in TortoiseSVN client 1.7.1 (might be available in some older versions as well):
SVN checkout --> Select URL of repository
Click on "Checkout Items" (under Checkout Depth) and select only the folders required!
Yes you can using SVN 1.6. You will need to do a checkout first then mark the folder for exclusion then delete the unwanted folder.
svn checkout http://www.example.com/project
cd project
svn update --set-depth=exclude docs
rm -fr docs
From now on any updates to the working copy won't repopulate the docs folder.
See http://blogs.collab.net/subversion/2009/03/sparse-directories-now-with-exclusion/ and http://subversion.apache.org/docs/release-notes/1.6.html#sparse-directory-exclusion for more details.
Tom
With versions prior to 1.5 I have found that if you checkout only the top most folder and then selectively update, from then on updates only effect what you have checked out. Ie.
svn co -N foo
cd foo
svn up -N bar
svn up
The -N flag makes the operation non-recursive. The above will not check out anything else at the foo level, eg. say there is a folder lala
, the final svn up will not check out that folder, but it will update bar
.
But at a later time you can svn up lala
and thus, add it to the checkout.
Presumably this also works with 1.5.
As a few others have mentioned, you can just use svn:externals properties and then the --ignore-externals option when you checkout. One thing to note, however, is that svn:externals does not necessarily need to refer to another repository. It can be a reference to some other folder in the same repo.