|
|
|
|
|
by kazinator
4029 days ago
|
|
git rebase is just a mechanized cherry picker. (Agricultural implement, really, when you think about it.) In fact, you can add arbitrary commits to the list, not only re-order the existing ones! I sometimes do this: $ git log --reverse --oneline here..there > arbitrary-picks
Then we edit the arbitrary-picks file so that it has the interactive rebase syntax: i.e. putting the word "pick" in front of every line. Then: $ git rebase -i HEAD # noop!
In the editor, we delete the "noop" line and read in the arbitrary-picks: :r arbitrary-picks
Wee, now we are picking all those commits into this branch, with the interactive rebase workflow. |
|
It was a neat trick and when it was done all the commits were nicely sorted into feature branches, as if we'd been doing that all along.