SVN: Ignore some directories recursively

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

    Create a file and add your ignores into it

    ingore-list:

    file1 
    directory1
    file2
    etc...
    

    then apply the following command

    for n in directory; do svn propset svn:ignore -F ignore-list $n; done
    

    directory is name of your directory, you can sub categorize as well directory/sub-directory. Or use * to note current directory you are under.

    This is assuming you are using bash as your shell

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

    add to your ~/.subversion/config or /etc/subversion/config file:

    [miscellany]
    global-ignores = build dist
    
    0 讨论(0)
  • 2021-01-30 12:39

    In subversion 1.8 over, it is possible to set global-ignores for current repository.

    svn propset svn:global-ignores build .
    svn propset svn:global-ignores dist .
    

    Also you can create a folder named .svnignore, and write conditions.

    build
    dist
    

    remember one condition per line, setting build/* or dist/debug is in vain. Then do the command:

    svn propset svn:global-ignores -F .svnignore .
    
    0 讨论(0)
  • 2021-01-30 12:44
    svn propset --recursive svn:ignore svn_ignore_rules .
    

    where svn_ignore_rules is a file containing the ignore rules -- one per line

    Of course you have to re-run it every time you add a new directory to your repo

    svn_ignore_rules can also be considered to be checked into the repo, to be re-useable by other users having write access to the repo

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

    One way would be to add some kind of check to either the pre- or post- commit hook but it's note straight forward if you don't own the repo server.

    0 讨论(0)
  • 2021-01-30 12:45
    cd parent_dir #the directory containing folder to be ignored recursively
    svn propedit svn:ignore . #will open up svn-prop.tmp
    enlist folder(s)
    ^X
    Y
    commit -m 'ignore targeted direcoty'
    
    0 讨论(0)
提交回复
热议问题