Complex interactive rebase in one step?

I have two branches in git with this shape.

* fffffff commit f
* ddddddd commit d
* bbbbbbb commit b
| * eeeeeee commit e
| * ccccccc commit c
| * aaaaaaa commit a
* 2222222 base revision 2
* 1111111 base revision 1

I want to rebase and reorder the commits like I would with rebase --interactive. However I want to interleave several of the commits and wind up with a shape like this.

* ffffff2 commit f
* eeeeee2 commit e
* dddddd2 commit d
* cccccc2 commit c
* bbbbbb2 commit b
* aaaaaaa commit a
* 2222222 base revision 2
* 1111111 base revision 1

Is there a way to do this rebase in one step? I tried to do it in two steps by rebasing commit b on top of commit e and then doing a second interactive rebase to sort all the commits. The problem is that I get merge conflicts (between commit b and commit e for example) that I would not see otherwise (by placing commit b after commit a) and it's not worth resolving the conflicts.


Start with any one branch (either BranchWithF or BranchWithE) and issue the interactive rebase, for example

git checkout BranchWithF
git rebase -i HEAD~3

When the editor and the commit list pops up, add (read: type on your keyboard...) and interleave

pick aaaaaaa
pick ccccccc
pick eeeeeee

to the list as you see fit.

Afterwards, BranchWithF will have all 6 commits, and you can throw away BranchWithE (which still has its 3 commits).

Need Your Help

C# Formatting - How to correctly format a name? I.e. forename or surname

string compact-framework formatting c#-2.0

I'm currently being visually assaulted by all of the names that are being displayed and entered on one of my systems. Basically, users have use of an on-screen keyboard and don't tend to write thin...

Exclude last occurance of duplicate nodes. Duplicates nodes are nodes with multiple attributes with same values

xml xslt xpath

I have been trying to write an XPath/XSLT for my problem of detecting and eliminating duplicate nodes. In my case, duplicate nodes are nodes with multiple attributes with same values. The way I wan...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.