SVN ignore like .gitignore

后端 未结 3 554
既然无缘
既然无缘 2021-01-29 23:24

In Git, if I have a project with lots of projects inside, let\'s suppose, a lot of Java projects, I can just create a .gitignore file in the root and it will \"be r

3条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-30 00:13

    You can use svn:ignore. You generally need to tell SVN to apply special properties to the files:

    svn propset svn:ignore "*.jpg" .
    

    (Note the dot at the end of the command.)

    For multiple files you can add a newline character.

    Type exactly like here with line breaks:

    svn propset svn:ignore "file1
    file2
    file3" dir1
    

    Check that the files are ignored:

    svn status --no-ignore
    

    Then commit the code.

    And yes, many duplicate questions are already available.

    You can refer my favorite svn cheatguide.

    You can create a file, svn-ignore.txt, with your ignored files and directories:

    *.class
    *.jar
    *.war
    *.ear
     target/
    .classpath
    .settings/
    .project
    .metadata
     bin/
    

    Now try the following:

    svn propset svn:ignore -RF /root/svn-ignore.txt . [dot for current dir]
    

    -R is for recursive.

提交回复
热议问题