giteclipseeclipse-emf

What files should be commited in the case of an Eclipse modeling project?


In your opinion, what Eclipse configuration files need to be included in git commits and what are those that should be ignored?

Specifically, I am talking about an Ecore/Xtext project using Eclipse modeling framework under ubuntu.

The files I am thinking of are : .DS_Store .metadata .classpath .project .settings

I have a doubt about META-INF build.properties plugin.properties

And what about .gitignore itself?

I believe generated source files in src and src.gen should be included in commits since I may need to edit them in the future. I am right? Or maybe should I include them only once I edit them?

Thank you in advance,


Solution

  • Let me preface that many people say you shouldn't commit any IDE specific files to avoid restricting projects to a particular IDE. But in my experience when working with Eclipse plugins/EMF/Xtext projects it makes everything easier to only use Eclipse and include them. You might not need them if you use a pure maven-tycho build process though.

    Anyway here is what I would commit.

    Project files that should definitely be committed, as these are part of the final product:

    Eclipse-specific files that should be committed:

    Files that should usually be committed:

    Files that shouldn't be committed:

    Keep in mind that IDE plugins could add additional files that may are or are not needed by others.

    You could also take a look at Github's .gitignore template for Eclipse. This template does exclude .settings though, which I usually would commit, if everyone in the team uses the same IDE plugins with the same configuration. It also excludes *.launch files, which you likely want to commit if your application requires complex launch configuration like often is the case for plugin projects.