I have a set of branches like the following:
* 444ddd - somefeature3 / * 333ccc - somefeature2 / * 222bbb - somefeature1 / ------* 111aaa - master If I were on a single branch (let's say somefeature3 without somefeature2 or somefeature1 existing), I could update all of my commits by doing git rebase -i 111aaa. In other words, I could go from this:
* 444ddd - somefeature3 / * 333ccc / * 222bbb / ------* 111aaa - master ...to this:
* 444eee - somefeature3 / * 333ddd / * 222ccc / ------* 111aaa - master In particular, commit 222bbb was replaced with 222ccc, 333ccc was replaced with 333ddd, and 444ddd was replaced with 444eee.
However, if I care about the branch pointers somefeature2 and somefeature1, they won't get updated in this scenario. I would go from this:
* 444ddd - somefeature3 / * 333ccc - somefeature2 / * 222bbb - somefeature1 / ------* 111aaa - master ...to this:
* 444eee - somefeature3 / * 333ddd * 333ccc - somefeature2 / / * 222ccc * 222bbb - somefeature1 / / ------* --------------* 111aaa - master What I want to have happen instead is for the final state to look like this, with the branch pointers somefeature2 and somefeature1 updated along with somefeature3:
* 444eee - somefeature3 / * 333ddd - somefeature2 / * 222ccc - somefeature1 / ------* 111aaa - master Is there any way to have Git automatically update the branch pointers for somefeature1 and somefeature2 as well as part of the git rebase -i, producing this end state?
(meta: this is similar to this question, but it goes further by asking if it's possible to have Git do the appropriate foo automatically)
git rebase -rexists, the internal rebase code has enough machinery to achieve the correct result; it just needs some external way to specify the right set of names to be updated.