SVN: Ignore some directories recursively

前端 未结 15 1289
粉色の甜心
粉色の甜心 2021-01-30 11:55

I don\'t want any directory named build or dist to go into my SVN no matter how deep in the tree it is.

Is this possible? In git I just put

相关标签:
15条回答
  • 2021-01-30 12:58

    It is not possible to do this. There are only two ignore mechanisms in Subversion, svn:ignore (which is nonrecursive) and global-ignores (which is not specific to a repository).

    0 讨论(0)
  • 2021-01-30 12:58

    Since there seems to be no solution for this probably common problem, i would like to share our solution. As the others already made clear, you can either use the svn:ignore property, this applies to a single directory (and therefore not for new ones), or you use global-ignores which applies to a single user (but doesn't belong to the repository).

    To make life a bit easier i created a reg file named Settings.Svn.reg and added it to the root of the repository. Now everybody can doublecklick this regfile once, and has the settings done.

    REGEDIT4
    
    [HKEY_CURRENT_USER\Software\Tigris.org\Subversion\Config\miscellany]
    "global-ignores"="obj *.suo *.bak *.pdb *.user *.Cache*"
    

    I would really appreciate a solution within the SVN repository, so if somebody knows, would you care to share it?

    0 讨论(0)
  • 2021-01-30 13:00

    It is possible to ignore build and dist dirs by removing the directories from version control. The trick is to use the --keep-local option to leave the directory in the working copy. For example:

    svn rm dist --keep-local
    svn ci -m'removed build directory from version control'
    

    The directory will no longer be tracked by subversion but it will still be there in your working copy to hold compiler output, etc.

    cheers, joe

    0 讨论(0)
提交回复
热议问题