How to ignore directories/files in Subversion?

25,247

Solution 1

To ignore files in subversion you want to set the svn:ignore property. You can see more here http://svnbook.red-bean.com/en/1.8/svn.advanced.props.special.ignore.html about half way down.

To ignore the target folder from your project folder run

svn propset svn:ignore target .

Alternatively to edit a list of ignored files folders run

svn propedit svn:ignore .

Solution 2

Before committing code to the Subversion repository we always set the svn:ignore property on the directory to prevent some files and directories to be checked in. We always exclude the IDE project files and the target/ directory. Instead of keeping all of the excludes in mind all the time it's useful to put them all in a file and reference the file with the -F option:

svn propset svn:ignore -F .svnignore .

Put this file in the project folder

.svnignore
target/*
Share:
25,247
techsjs2012
Author by

techsjs2012

Updated on July 05, 2022

Comments

  • techsjs2012
    techsjs2012 almost 2 years

    How to setup my Subversion so it ignores target files generated by Maven on Linux? I don't want to commit them into SVN.

    How do I do this on Linux and Mac command line?

  • techsjs2012
    techsjs2012 over 11 years
    can you give me a list of files you added
  • issamux
    issamux almost 10 years
    is there one file in root of project (/.svnignore ) or we must set it for each Subproject in svn ?
  • Grim
    Grim about 8 years
    If you use eclipse you should add the folder to "ignored resources" (window > preferences > team > ignore resources)!