Eclipse & SVN on Linux : How to add files to ignore list automatically

Eclipse (software)

Eclipse (software) (Photo credit: Wikipedia)

First of all you need to create a new file on the root of the project with the list of file to ignore like the following (this is a typical list of file that we need to exclude from an Eclipse project)


and after on the console (shell) you have to run the following command assuming that you have called the previous file ignore.txt

svn propset svn:ignore -RF ignore.txt .

(Please note the “.” at the end of the command). The -R is the recursive option

Now you can run eclipse and access to the SVN View and commit all the local changes

This is very usefull if you have alread a large project that you want to import on Eclipse and do you want to avoid to ignore every file manually by means of eclipse

Enable keywords substitution using Eclipse and Subversion (SVN)


Image via Wikipedia

To enable keywords substitution as I usually have with the CVS, you just need to enable a svn properties on the Eclipse project configuration.

These are the steps to activate the svn-keyword-substitution feature in Eclipse:

  1. Install Subclipse into your Eclipse application
  2. Right-mouse-click on your project folder, and choose Team => Set Property from the popup menu (note to click on the root of the project folder)
  3. Enter the property name:  svn:keywords
  4. Enter the text property:  Author Date Id Revision HeadURL
  5. Click the  Set property recursively checkbox
  6. OK

Note that on large project files this action could take also several minutes. Now keywords are substituted when you commit a file in SVN, just like they were by using CVS.  Also, you can shorten Revision to Rev and HeadURL to URL.

So if you now have a file like:

// File name: $HeadURL$
// Revision: $Revison$
// Last modified: $Date$
// Last modified by: $Author$
//  file description

commiting it to the SVN will result into:

//  File name: afile.php
//  Revision: 1
//  Last modified: 2010-11-4 14:53
//  Last modified by: quonn
//  file description