Subversion Ignore How To (svn ignore)

svn ignore » The Best Way

  1. Go to the directory which holds the file or folder to ignore.
  2. svn delete the files to ignore then svn commit -m "Goodbye Files"
  3. important – do a svn update
  4. Add a file listing the file/folder names to ignore (relative path)
  5. Run This » svn propset svn:ignore -F IGNORED_FILES.TXT .
  6. The Reply is (property 'svn:ignore' set on '.')

Delete Repository Files But Keep Working Copies

If you want to keep working copies (and perhaps ignore them) that have already made their own way into your SCM (version control system) – a useful tactic is to delete them from the repository but keep the local working copy files.

To keep the working copy copies, use this.

svn delete test-classes --keep-local

The 3 Version Control Ignore Patterns

You can opt for behaviour akin to the first and last patterns below. Not the middle one.

  1. You don’t wan’t anyone with any working copy to check in (eg target directory)
  2. this working copy must NOT receive – ignore that huge file over there in the SCM
  3. this working copy must NOT transmit – ignore these here WC files (don’t VC them)

Number 2 is tough because once the file is versioned there’s no ignoring it. No sirree! Subversion keeps a-hold of anything it knows about.

Option 1 is essentially a global ignore whilst option 3 is a local ignore.

The [svn:ignore] Property

The below commands can be executed. The ignore file is superior because the output from the below queries is (frankly) as clear as mud – thus as useful as a chocolate teapot.

set the svn:ignore property

svn propset svn:ignore test-classes .

get the svn:ignore property

svn propget svn:ignore

list all properties here

svn proplist

delete the svn:ignore property

svn propdel svn:ignore

svn:ignore – Subversion Ignore Command Usage

Subversion responses when you tell it to ignore files inside a JAVA project’s target directory.

svn propset svn:ignore -F IGNORED_FILES.TXT .

The response from the big svn ignore command is at best meagre!

property 'svn:ignore' set on '.'

Executing svn proplist just lists the one single svn:ignore property (unless you have other properties set).

Delete IGNORED_FILES.TXT If Necessary

If the staging text file is okay where it is – leave it there. It documents what has happened and is visible to others. Its contents make clear what exact files and/or folders have been (are being) ignored.

Sometimes this text file is in a sensitive place – if it upsets the eco-balance then by all means do the common sensical thing and delete it when you are done.

How to Ensure Subversion is Ignoring your Files

A couple of svn updates and checkins in and around the place does not hurt. In addition to that however, is asking subversion what files it ignores.

The bees knees method of doing this is subversion’s property get command which is sent along with the parameter “svn:ignore“.

svn propget svn:ignore

The response gives us everything in IGNORED_FILES.TXT »


Double check that the output of this command mimicks every file line to assume reassurance of a successful ignore use case. If you get it, you haven’t been ignored – so lights out and away you go!

Leave a Reply

Your email address will not be published. Required fields are marked *