If you are using Subversion (SVN) and Eclipse on Linux you will soon find out that projects in Eclipse will be marked as "dirty" (e.g. the local working copy is different from the remote copy, thus in normal conditions you should be committing) even when you have just committed. The reason is that some of the files auto-generated by Eclipse and other tools such as Maven are indeed in the local working copy but usually we don't want them committed in the SVN repository, since each user has her own settings.
The way this problem is solved is to add the svn:ignore property to the folder(s) where you want some file types to be excluded. A (non fully comprehensive) list of such files is:
- .project (Eclipse generated)
- .classpath (Eclipse generated)
- .svn (Subversion generated)
- target (Maven generated)
- etc
If you are working on Windows platform there is a nice SVN IDE called TortoiseSVN which provides a graphical interface where users can easily add the svn:ignore property to a set of folders.
However if you are working on Linux platforms, alas TortoiseSVN is not available, but luckily enough specifying this property from the command line is quite straight forward.
The normal syntax is:
svn propset svn:ignore [file|folder] [path]
Where:
- [file|folder] is the file or folder which we want SVN to ignore
- [path] is the path to the SVN file or folder to which we want to add the svn:ignore property
However you will soon find out that on a typical project you want to add more than one [file|folder] (e.g. all the files/folders listed above). Unfortunately the svn:ignore command doesn't allow you to add all these files/folders on a single line; however the svn:ignore command allows, through the -F option to specify a file containing the list of svn:ignore files|folders.
In my environment, I created a svn-ignore-list.txt file containing the list of files to exclude from SVN as follows:
$ mkdir -p ~/development/common
$ vim svn-ignore-list.txt
# The content of the file follows:
.*
target
target/**
From the root path of my SVN project I simply typed the following command (please note the '.' -dot- at the end of the command which specifies the current folder):
$ svn propset svn:ignore -RF /home/mtedone/development/common/svn-ignore-list.txt .
The -R option tells SVN to apply this property recursively to all subfolders, which is what you want most of the time.
Happy technology to everyone!
M.
That worked for me.
Thanks a lot.
Posted by: KraTos5589 | Friday, 17 August 2012 at 12:21