I'm using Emacs + it's in very many ways fabulous magit-mode to work with git. There is one aspect of my workflow though that I can't map to this, and thus this question.
Sometimes you have a commit which should be reworked into separate commits. I can interactively rebase my commits with magit, and declare my intend to edit said commit.
Now I have to switch over to git gui, select "ammend last commit" which shows me the staged changes, and unstage those parts I want to become a separate commit. Then I commit, stage the exclusions, and commit again - voila, I have a new commit within my history.
I have so far not found a way to accomplish this using Emacs. Any hints?
After your begin the rebase, instead of going to the gui, do a magit-reset-head to HEAD~1, this will put you in the position to unstage the changes, and stage and commit as desired before finally Continuing the rebase from the magit status buffer.
Example scenario workflow:
magit-log
magit-reset-head
(x), specify HEAD~1
in prompt.You will now have four commits, each changing one file in the order A, B, C, D.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With