Bug 431813 - Switch branch into a new workspace.
Summary: Switch branch into a new workspace.
Status: NEW
Alias: None
Product: EGit
Classification: Technology
Component: UI (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-02 10:41 EDT by Christophe Bouhier CLA
Modified: 2014-04-03 17:04 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christophe Bouhier CLA 2014-04-02 10:41:53 EDT
Hi, 

There is a usage pattern for working with branches, git and workspaces. 
Switching branches within Eclipse is not optimal, as projects come and go from branch to branch, leaving the workspace in a flux state (Projects are actually being recreated when disappearing from a branch). 

The topic is discussed here: 

http://stackoverflow.com/questions/18556263/eclipse-git-branches-working-sets-and-target-platform-why-egit-sucks-in-this


I would like the procedure proposed in the answer to be available in EGit. 
This is : 

1) Clone and work on a separate branch. 

git clone repo br_dir 
cd br_dir 
git checkout br 
cd repo 
git remote add -t br_dir br_repo ../br_dir
=> Let EGit create and switch the workspace here. 

2) Merge the work. (This could be a regular git workflow after the user has switched back to the local origin). 

git fetch br_repo 
git checkout br
git merge br_repo/br
Comment 1 Robin Rosenberg CLA 2014-04-03 17:04:39 EDT
Why not propose to fix the problem instead of working around it? Gitsters tend to have lots of branches so that would lead to lots of workspaces and lots of clones.

That said sometimes there is a need to work with things in parallel, ie. when you have a lot of things in a unstable state and you need to fix an emergeny, which is another situation than the one you describe, but could be solved by your solution.