Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What files should be committed to github for an eclipse project

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 ?

like image 720
blue-sky Avatar asked Oct 03 '12 13:10

blue-sky


People also ask

How do I commit a project from Eclipse to GitHub?

Step 1: Open Eclipse IDE and right-click on the project you want to push and go to Team->share project. Step 2: It will add the project to the given repository as shown below: Step 3: Again right-click on the project and go to Team->commit.

What is needed for Git commit in Eclipse?

To prepare a commit, files from this 'Unstaged Changes' area need to be selected and dragged down to the 'Staged Changes' area below (like an 'add' command in Git). Once dragged, these files are staged and ready to be committed.

Do we need to commit .classpath file?

classpath file is make sure you don't reference files outside of your project. Eclipse stores the location of these files with a full filepath, and you would need to make sure other developers had those files in exactly the same place.


2 Answers

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.

like image 72
mmounirou Avatar answered Sep 22 '22 05:09

mmounirou


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).

like image 36
Starwave Avatar answered Sep 26 '22 05:09

Starwave