3

In my team, we have one guy using some big chunk of code that I am not using. Due to its size, I'd like not to have it on my computer unless I need it. So I simply deleted the whole directory on my PC while not committing this delete operation to SVN. Of course, SVN now tells me that hundreds of files are missing. Can I tell my SVN to ignore this directory when showing the status report?

So it's kind of global ignore setting, but the other way round.

2
  • I don't understand why this doesn't work for you: stackoverflow.com/a/635787/761095
    – bahrep
    Aug 25, 2014 at 15:11
  • @bahrep: May be it should but I do not understand how to use it. Would you care to explain? Say, I have Dir1 and Dir2 in my repository. How can I make TortoiseSVN ignore Dir1 and just update and commit whatever happens to Dir2? I tried adding "Dir1/*.*" and then "Dir1*" to TortoiseSVN > Settings > General > Global ignore pattern, but on "Commit...", TortoiseSVN still shows hundreds of "missing" files in Dir1.
    – texnic
    Aug 27, 2014 at 16:47

1 Answer 1

3

It sounds like you're actually looking for a "sparse checkout" containing only items of interest to you: http://svnbook.red-bean.com/en/1.7/svn.advanced.sparsedirs.html

That chapter of the SVN book gives far more detail than I can cover here, but the quick-and-dirty is (for the command line) that you can use svn checkout --depth ... followed by svn update --set-depth ... commands to build a working copy including only the directories and files of interest to you, that will remain in that state even through update and other operations.

You mentioned TortoiseSVN, as well. You can do the exact same thing in TortoiseSVN using the "Update to Revision" context-menu item on each file or folder in your checkout, but a much easier way is in the "Update to Revision..." dialog for the entire working copy, or the "Checkout" dialog. These dialogs have a "Choose Items..." button. Clicking that button will present a directory tree where you check or uncheck items to include in you working copy all in one operation when you complete the update or checkout.

2
  • I might be missing something, but (1) can I achieve the same without each time de-selecting the directories I don't need? (2) What about commit? At commit, I get numerous "missing" messages for the directory that I didn't check out.
    – texnic
    Aug 27, 2014 at 16:36
  • (1) yes, you only need to do this one time. After that, the working copy remembers what you had selected, so you can just do "update" instead of "update to revision" and only the directories you left selected should be updated. (2) if you get "missing" messages, then you must have manually deleted the directory rather than using the sparse checkout method. The sparse checkout method should remove these messages.
    – Ben
    Aug 27, 2014 at 17:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .