Eclipse – Managing multiple branches in Eclipse, or getting a VS-like setup for Eclipse


In VS, it's simple. Everything the project needs is stored in the project folder and all VS settings are stored in one place. Eclipse, however, stores Eclipse settings with the project and keeps a .metadata at the workspace level which is needed to detect the projects in the workspace. Thus, I can't simply branch a project and then open it in Eclipse. I need to set up a workspace, branch it into that workspace, copy over all my workspace settings (settings import/export doesn't even work right in Eclipse) so I have the same Eclipse settings, then do some kind of import to get the project in the workspace. This is what I generally refer to as a pain in the freaking neck, and it causes me to not branch any Java projects and to keep them all in one folder. This is also a pain.

Is there any way I can get a setup where I can just branch a project and open it in Eclipse, while maintaining the same Eclipse settings?

UPDATE: The current state of the question is expressed by the comment to soru's post.

Best Solution

Pretty sure you want to:

  • Keep the same workspace for all projects (or maybe a few, at the level of say 'hobby' and 'work').
  • switch between different branches in the same project by using the features of your version control tool/plugin
  • if you want to work on multiple branches at the same time, just create two projects, and manage them both as above.
  • if you want to temporarily hide the inactive version, use the 'working set' feature.

The main limitation is that you might want to have projects with the same name, but you can't. So sometimes you have to make up a project name different from the underlying folder name.

In general, mapping between VS and Eclipse:

  • Installation <-> workspace
  • Solution <-> working set
  • Project <-> project or folder or VC system branch or working set node


VS object model

using working sets in Eclipse

working with branches in subclipe