SVN: Can you remove directories from a local checkout only (not from the repository)?

后端 未结 5 1990
栀梦
栀梦 2021-01-31 01:57

Assume that you have a directory under subversion control, that contains some files and tons of subdirectories, like that:

file1.txt
file2.txt
file3.txt
dir1/
di         


        
5条回答
  •  眼角桃花
    2021-01-31 02:49

    What I'm trying to do cannot be done with Subversion 1.4 or Subversion 1.5; Period.
    No work around exists, that's just the way it is.

    It can be done with Subversion 1.6, though.

    Unlike SVN 1.5, SVN 1.6 can reduce the depth on a directory

    svn up --set-depth exclude dir2
    

    is the solution. It sets the depth for dir2 to zero and it will immediately vanish from the checkout and no update will bring it back, unless you explicitly set the depth of this directory to a value again (or just do an update on it without depth option, since not giving any depth always means infinity, unless you use non-recursive, which means "files").

    TIP:
    Actually SVN 1.6 cannot really reduce the depth the same way it can increase it. You can increase it from any level to any higher level. You can only reduce it to "exclude" (the lowest level of all). If you want to reduce from "infinity" (highest) to "files" (somewhere in the middle), you must first reduce it to "exclude" (causing the directory to vanish) and then increase it back again to "files". This is a bit of a hack, but it works just nice.

提交回复
热议问题