Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When working with Eclipse, should I add the workspace to the source control?

I am the only developer on this project.

like image 979
AngryHacker Avatar asked Sep 15 '09 19:09

AngryHacker


People also ask

Where should I put my Eclipse workspace?

At the end of the day, I would recommend that you put your workspace wherever you'd like. When you initially install Eclipse, it should ask you where you want your default workspace, choose browse and decide based on your personal preference. You can always create multiple workspaces for different types of projects.

How does Eclipse workspace work?

A workspace is a location on your machine where all the work you do through Eclipse will be stored as files. It is easier to create one workspace and save it as default so that your application remembers your past work.

How do I manage workspace in Eclipse?

If you want to choose the workspace every time you start Eclipse, go to Window -> Preferences -> General -> Startup and Shutdown -> Workspaces and check the box at the top for 'Prompt for workspace on startup'.

Can I have multiple workspaces in Eclipse?

You can create multiple workspaces in Eclipse. You have to just specify the path of the workspace during Eclipse startup. You can even switch workspaces via File→Switch workspace. File→Import→Existing project in to workspace→select project.


2 Answers

I would not add the complete workspace, but I would add the .classpath and .project files (as well as the source, of course) so that you can recreate the project if needbe.

like image 195
akf Avatar answered Jan 02 '23 19:01

akf


I wouldn't commit the whole workspace. But it is worth exporting platform settings and checking them into source control (probably in a separate SCM project as they don't really belong to any individual project) if you've made several changes in case you need to import them into a new workspace.

Examples of these files are those settings for:

  • Java->Code Style->Formatter
  • Java->Code Style->Clean Up
  • Java->Code Style->Code Templates
  • General->Editors-Text Editors-Spelling-Dictionary
  • Any other preferences you've made extensive changes to that support import/export

You should check in the primary sources/resources for the project. As others have noted, for a typical project this includes the .project and .classpath files.

Depending on the type of project, I'd add the .settings folder from the project. This folder contains project-specific settings that override the platform preferences, and other project-specific settings. If those are essential to your project then I would add them.

like image 36
Rich Seller Avatar answered Jan 02 '23 21:01

Rich Seller