Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

what all to keep in version control?

 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you keep .classpath file in version control?

I used to think that thumb rule is - any file which is not generated by "us" shouldn't be there in version control.

But if we don't keep .classpath then will not it give build path errors when we get the code from version control?

There are other files/folders too like .settings, .project, .apt_src folder (generated by weblogic only, I guess) etc which confuses me.

Thanks.
 
Freddy Wong
Ranch Hand
Posts: 959
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't keep .classpath in the version control because if you give freedom for the developers to use any IDE they prefer, the .classpath isn't very useful to them. But if you have a policy that all the developers must use Eclipse, then you may want to keep the .classpath.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18020
47
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I do keep the .classpath (and .project) Eclipse files in version control. But I don't keep absolute pathnames in it. I define symbolic references for the items that are outside the project's directory so that people with different setups can participate with minimal effort and with no change to the project itself. Among other things, that means if I'm playing in a mixed Windows/Unix environment, which I've been known to do, I define TOMCAT_HOME as something like C:\TOMCAT on one machine and /usr/local/apache-tomcat on another. But the mappings are in each machine's Eclipse environment, not in the project, so the project ports.

I do likewise for IntelliJ, which has 3 IDE-specific files. However I only version-control the 2 that are user-independent and omit the one that contains my local workspace info (what windows are open and where I'm editing). I believe that's the ".iws" file. Putting that one in version control can lead to trouble.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic