If I have a set of branches with common ancestor commit a
, is there an easy way to rebase all of them onto commit b
(where the common ancestor of a
and b
might be some third commit c
)?
Asked
Active
Viewed 182 times
3

rampion
- 87,131
- 49
- 199
- 315
-
Are you trying to rebase the commits since `a` on each branch, or the commits since `c` on each branch? – Lily Ballard Feb 08 '12 at 20:47
-
See also [how I'd rebase a whole subhistory -- several branches, with some links between them resulting from merge](http://stackoverflow.com/a/9706495/94687). The unpleasant part of that solution is the need to reset the topic branch refs to the new rebased commits afterwards. – imz -- Ivan Zakharyaschev Mar 14 '12 at 22:04
1 Answers
4
Yes. Just rebase them all.
If you anticipate repeated conflicts, enable git-rerere, which records your conflict resolutions and is able to automatically apply the same resolution when merge encounters the exact same conflicts in another (re)merge.
Or you could,
Isolate commit
a
in a branchgit checkout -b temporary <commita>
Rebase the
temporary
branch onto commitb
.Rebase all the 'related' branches onto the resulting branch
temporary

sehe
- 374,641
- 47
- 450
- 633