14

What files should I commit to github so that its a valid Eclipse project ?

I am just committing my source files and packages but when I try to re-create the project I receive this error 'no projects found' :

enter image description here

I think I need to also commit the .project file ?

Luke Girvin
  • 13,221
  • 9
  • 64
  • 84
blue-sky
  • 51,962
  • 152
  • 427
  • 752
  • Each Eclipse project has different layout (Web, Standalone etc). So the question is what Eclipse project you are dealing with. Then customize your `.gitignore` file accordingly. The `.project` file should be versioned in any case – pankar Oct 03 '12 at 14:00

2 Answers2

10

You need to commit your:

  • .settings dir
  • .classpath file
  • .project file

The better idea will be to use maven for your project so that you will have a common configuration for all the IDEs (eclipse, netbeans, ideaj ...) and no need to push your eclipse specific configuration.

Jordão
  • 55,340
  • 13
  • 112
  • 144
mmounirou
  • 719
  • 6
  • 12
3

For a typical Java SE Eclipse project, you must commit .project and .classpath files, but not necessary .settings folder. I tested this scenario by committing one project from my windows environment and cloning that onto my Linux environment; Eclipse imported and run this project without any error. Hope this tip helps you reduce committing one folder (the .setting).

Starwave
  • 31
  • 7