Svn Checkout the Contents of a Folder, Not the Folder Itself

SVN checkout the contents of a folder, not the folder itself

Just add a . to it:

svn checkout file:///home/landonwinters/svn/waterproject/trunk .

That means: check out to current directory.

How to checkout few files and folders alone without checking out entire source

Apart from just checking out the folders you want (which only works if you want the entire subfolder tree as well), Subversion 1.7 supports something referred to as "sparse directories". Basically you can checkout a folder to a certain depth, and then afterwards "drill down" into the folders you are interested in.

Using the command line client, you use the --depth and --set-depth options to svn update. If you are using TortoiseSVN, there is a "Checkout Depth" option in the checkout dialog.

EDIT: To clarify against your specific question, you would first to a checkout of your source tree with depth "immediates". This will give you all your folders, but they will initially be empty. Then you can drill down in the Extensions and Themes directories by updating them to "fully recursive" depth (svn update --set-depth infinity or in TortoiseSVN "Update to revision → Update Depth → "Fully Recursive").

EDIT: The update depth can be seen as a sort of "visibility level", and is remembered by Subversion, i.e. if you do a svn update on your working copy, it will only update to the current visibility level.

SVN checkout ignore folder

You can't directly ignore folders on a checkout, but you can use sparse checkouts in svn 1.5. For example:

$ svn co http://subversion/project/trunk my_checkout --depth immediates

This will check files and directories from your project trunk into 'my_checkout', but not recurse into those directories. Eg:

$ cd my_checkout && ls
bar/ baz foo xyzzy/

Then to get the contents of 'bar' down:

$ cd bar && svn update --set-depth infinity


Related Topics



Leave a reply



Submit