The maintainer of a specific (embedded) linux kernel repo has modified a bunch of ancient commits in order to clean up the history. As a consequence all commits have a different SHA.
When I git fetch from this rewritten history, I'm in the need of rebasing my local branch(es) to the local tracking branch entry point which corresponds to the point in the local tree where my own branches start. Standard solution:
git rebase --onto SHAxx master ownbranch
(SHAxx corresponds to c2 of remotes/origin/master in the graph below).
However, when I have several own branches that have one single ancestor in master, I have to apply a rebase for each individual branch. Instead I want to transfer all of the branches with any associated tags to the new entry point in the fetched tracking branch in a single action.
Graphically, state after fetch, before any action (simplified - beyond left is deep master history):
c1'--c2'--c3'--c4'--c5'--c6'--c7--c8--c9 remotes/origin/master
/
--o--c1--c2--c3--c4--c5--c6 master
\
o---o---o---o---o branch1
\
o---o branch2 (etc.)
To be precise: when my own work starts at master commit c2, I want to rebase my own subtree with all its tags (when present) in one action onto c2' of remotes/origin/master (with its distinct SHA compared to master's c2).
At that time I can remove master completely and make remotes/origin/master the new master with my own work:
c1--c2--c3--c4--c5--c6 (old master, not referenced anymore)
/
--o--c1'--c2'--c3'--c4'--c5'--c6'--c7--c8--c9 master = remotes/origin/master
\
o---o---o---o---o branch1
\
o---o branch2 (etc.)
Then I'd test if the build process yields the same result as before and if OK: proceed in having merged master updates incrementally (e.g. per subindex nn step in 2.6.nn) into my own (board-specific) branch.
Or is there another/better approach to realize the same result?
A possible solution is presented at Rebasing a branch including all its children, but tags aren't moved over.