Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should I keep my project files under version control? [closed]

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

like image 521
cretzel Avatar asked Sep 22 '08 17:09

cretzel


People also ask

Should I use version control?

Version control is important to keep track of changes — and keep every team member working on the right version. You should use version control software for all code, files, and assets that multiple team members will collaborate on. It needs to do more than just manage and track files.

Why is version control a problem?

The version control system merges your uncompleted changes in the working copy with the ones in the repository. This may force you to resolve conflicts. It also loses the exact set of edits you had made, since afterward you only have the combined version.

Should you commit IDE files?

I know this is an unpopular advice but: commit the IDE project files in the repository. Once a member has a successful local setup, the files should be committed so that everyone else can just checkout/update, and get the project running.


1 Answers

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.

like image 196
VonC Avatar answered Oct 03 '22 12:10

VonC