Monthly Archives: September 2011

Ignoring files in subversion

Often you find that you have files that are part of your project that do not belong in version control and you just don’t want to be bugged by subversion highlighting the fact that you haven’t checked them in.

There is documentation on how to ignore these files in the svn book but I found that it lacked a small detail.

Ignoring files globally

There are some files you know that you will never want to check into the repository no matter what project you are working on.  Rather than having to mark them to be ignored in every directory of every project that you store in the repo you can instead set a global ignore.

In your subverison client install directory (for unix operation systems it is probably called .subversion) there is a file called config, scroll down to the section marked global-ignores and set the patterns you wish to ignore

global-ignores = *.o *.lo *.la *.al .libs *.so *.so.[0-9]* *.a *.pyc *.pyo
*.rej *~ #*# .#* .*.swp .DS_Store .classpath .settings .project

As you can see, you can use regex to define each pattern. Each pattern is separated by a whitespace.

Setting ignore on a specific directory

N.B. You cannot ignore individual files, you can only set patterns to ignore in a given directory.
First navigate to that directory and issue this command:

svn propedit svn:ignore .

After this you will be presented with a file in which you should type in your pattern(s) to ignore.
It’s pretty simple but I just didn’t spot the fact that you should be putting the patterns in this file rather than specifying the pattern in the svn propedit command itself.

Don’t forget to commit your changes!
Happy ignoring!

Eclipse Package Explorer

Eclipse Indigo

Have you ever had the irritating scenario where all your Java folders (including the empty ones) appear in Package Explorer even though you have correctly created the build path?

I was getting rather irritated by this intermittent “feature” so I asked a friend!

The simple solution is to filter out the unwanted empty folders.

  • Click on the downwards arrow in the top right hand side of the Package Explorer window
  • Select Filters and then make sure that “Empty Packages” is ticked

Now you will see a much cleaner representation of your project in Package Explorer