|
|
|
|
|
by exDM69
4031 days ago
|
|
This can be easily solved without aliases by adding a new commit on top, then using `git rebase -i` to re-order and squash the commit on top of another one. It wasn't immediately obvious to me that you can also re-order patches using `rebase -i`. I've used for squashing and dropping temporary code before but realizing it can also reorder commits was really useful. |
|
In fact, you can add arbitrary commits to the list, not only re-order the existing ones!
I sometimes do this:
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: In the editor, we delete the "noop" line and read in the arbitrary-picks: Wee, now we are picking all those commits into this branch, with the interactive rebase workflow.