Should I keep my project files under version control?

cretzel picture cretzel · Sep 22, 2008 · Viewed 17.5k times · Source

Should I keep project filesm like Eclipse's .project, .classpath, .settings, under version control (e.g. Subversion, GitHub, CVS, Mercurial, etc)?

Answer

VonC picture VonC · Sep 23, 2008

You do want to keep in version control any portable setting files,
meaning:
Any file which has no absolute path in it.
That includes:

  • .project,
  • .classpath (if no absolute path used, which is possible with the use of IDE variables, or user environment variables)
  • IDE settings (which is where i disagree strongly with the 'accepted' answer). Those settings often includes static code analysis rules which are vitally important to enforce consistently for any user loading this project into his/her workspace.
  • IDE specific settings recommandations must be written in a big README file (and versionned as well of course).

Rule of thumb for me:
You must be able to load a project into a workspace and have in it everything you need to properly set it up in your IDE and get going in minutes.
No additional documentation, wiki pages to read or what not.
Load it up, set it up, go.