Is there a way to step back a commit during an interactive rebase?
Git gets to the edit dd1475d operation, stops, and prints the following message to the terminal: You can amend the commit now, with git commit --amend Once you are satisfied with your changes, run git rebase --continue. At this point, you can edit any of the files in your project to make any additional changes.
'revert' means to add more commits to make the code look like it did at a different commit, but the history is different (the history includes the old state and the path back to the different state). rebase doesn't change the code at all, but just changes the history.
When you have resolved this problem run "git rebase --continue". If you would prefer to skip this patch, instead run "git rebase --skip". To check out the original branch and stop rebasing run "git rebase --abort".
Yes there is. How to step back during an interactive rebase:
git rev-parse HEAD
git rebase --edit-todo
pick <hash from step 1>
git reset --hard HEAD^
Now you are still in the rebase but one commit back and you are free to continue rebasing with
git rebase --continue
.If you don't want the undone commit to be picked straight up without edits you can add edit <HASH>
instead of pick <HASH>
to the todo list (step 3).
Addendum: You can remember more hashes, reset to an even earlier point and add multiple picks to redo more than one commit.
Idea from: http://arigrant.com/blog/2014/5/4/git-rebase-stepping-forward-and-back
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