You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Turn a fork that has periodic merges of upstream into easily upstreamable rebaseable linear history (git-imerge rebase through merges)
find commits
git log origin/main..my_fork_with_periodic_merges
mark commits
mark latest common commit before any merges and mark as root point (Ar), its first commit mark A1,A2... upto next merge commit
mark merge point origins (Bo, Co, ...)
mark merge point commits (Bm, Cm, ...) and commits after them B1,B2, ..., C1, C2, ...
create branches A,B,C, ... from last commit before the merge
Ar -> T # parent of A1
A1 # oldest commit that is returned by the command above
A2 # A1's child
A3 # A2's child
Bm (merge A3, Bo) # merge-commit in the fork that merges origin/main
B1 # Bm's child
B2 # B1's child
Cm (merge B2, Co) # and so on...
C1
C2
C3
C4
do the magic
git switch Ar -C T
git cherry-pick A1,A2,A3
git imerge rebase Bo
git imerge finish
git switch -C A-over-Bo-main
git switch Bm -C A-over-Bo-full
git reset --soft A-over-Bo-main
git commit -m "Additional changes from Bm: $(extract-commit-message Bm)"
git checkout T
git reset --hard A-over-Bo-full
git cherry-pick B1, B2
git imerge rebase Co
git imerge finish
git switch -C B-over-Co-main
git switch Cm -C B-over-Co-full
git reset --soft B-over-Co-main
git commit -m "Additional changes from Cm: $(extract-commit-message Cm)"
git checkout T
git reset --hard B-over-Co-full
git cherry-pick C1, C2, C3, C4