SVN: Ignore some directories recursively

前端 未结 15 1295
粉色の甜心
粉色の甜心 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:55

    You first have to move to the top folder of your working copy and create a file there (say .svnignore) where you should place all the patterns that you want to be ignored, for example (for an Android project):

    bin
    gen
    proguard
    .classpath
    .project
    local.properties
    Thumbs.db
    *.apk
    *.ap_
    *.class
    *.dex
    

    Then you run the following command (remember that you must be at the top folder of your working copy):

    svn propset svn:ignore -R -F .svnignore .
    

    This will only work for folders and files that are not yet under version control. If you want a folder (or file) that is being versioned to start being ignored as well, remove it from version control by running the command:

    svn rm --keep-local 
    

    Got all this from this great article that explains it all: http://superchlorine.com/2013/08/getting-svn-to-ignore-files-and-directories/

提交回复
热议问题