6

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?

Line
  • 1,397
  • 3
  • 14
  • 39
techsjs2012
  • 1,697
  • 5
  • 25
  • 56

4 Answers4

13

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 .
bahrep
  • 27,991
  • 12
  • 99
  • 140
Adam Schreiner
  • 484
  • 2
  • 5
9

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/*
David Newcomb
  • 10,316
  • 3
  • 45
  • 57
Roman C
  • 48,723
  • 33
  • 63
  • 158
0

Use svn propset:

svn propset svn:ignore directory .
Alex DiCarlo
  • 4,793
  • 17
  • 34
0

I find a simple way that you can add it to svn:ignore in eclipse IDE after adding the target folder to revision and then restoring it.

Geln Yang
  • 892
  • 2
  • 20
  • 35
  • If you use eclipse you should add the folder to "ignored resources" (window > preferences > team > ignore resources)! – Grim Jun 15 '16 at 09:04