1

My question extends the post " Suggestions for Grails .gitignore " which delves into what files and/or folders are good candidates for being in the .gitignore file.

Suppose you have a .gitignore file populated with Eclipse project-specific files (.project, .classpath, etc). Now suppose you go to a different machine and clone this repo. How can you pull your entire project into Eclipse and treat it like a java or python project when the very files deeming it so (.project, .classpath) are not committed?

I understand you can use Maven for Java applications but I'd be very appreciative for insight into the above question. If I am missing something, I'd be very thankful for clarification.

Thanks in advance,

Community
  • 1
  • 1
rampamycin
  • 13
  • 4

1 Answers1

0

With most Eclipse projects, you can change in the wizard where the new project will be created. With this, instead of creating a new project in the workspace, you can create a project by using the location of an existing folder, in your case the root folder off your java project. You may have to reconfigure the project to work (setting up the classpath again or similar kind of configuration).

You can try with a new Java project: File -> New -> Java Project -> change the default location for a folder containing your Java code without the ".project" file -> Finish.

Keep in mind that even if this is a basic feature of most Eclipse new project wizards it is not in all new project wizards (for example, I don't know if the python plugin provides this option).

Stephane Begaudeau

sbegaudeau
  • 1,504
  • 13
  • 18
  • That's a great answer. Thank you. I simply created a .gitignore and whenever I pull my repo, I did as you suggested: create a new project in-place of the repo. As a result, every time I push a new version, I maintain the projects integrity (because project-specific files are not uploaded). – rampamycin Jan 06 '12 at 06:09