Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SVN checkout ignore folder

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 some externals that I need.

like image 881
Zote Avatar asked Oct 10 '08 19:10

Zote


People also ask

How do I ignore a folder in svn?

If you want to ignore all CVS folders, just add CVS to the ignore list. There is no need to specify CVS */CVS as you did in earlier versions. If you want to ignore all tmp folders when they exist within a prog folder but not within a doc folder you should use the svn:ignore property instead.

How do I ignore target folder in svn?

To ignore files in subversion you want to set the svn:ignore property. You can see more here http://svnbook.red-bean.com/en/1.8/svn.advanced.props.special.ignore.html about half way down. svn propset svn:ignore target . svn propedit svn:ignore .

How do I ignore files in svn?

If you are using TortoiseSVN, right-click on a file and then select TortoiseSVN / Add to ignore list. This will add the file/wildcard to the svn:ignore property. You can find this list in the context menu at TortoiseSVN / Properties.

How remove checked out folder from svn?

Use TortoiseSVN → Delete to remove files or folders from Subversion. When you TortoiseSVN → Delete a file or folder, it is removed from your working copy immediately as well as being marked for deletion in the repository on next commit.


2 Answers

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 
like image 114
Jon Topper Avatar answered Sep 19 '22 05:09

Jon Topper


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

like image 45
tommy_turrell Avatar answered Sep 22 '22 05:09

tommy_turrell