git rebase interactive command
When rebasing commit history via git rebase -i we can use the following command. Example use-case
# In the todo list:
edit abc1234 Fix typo
Here are the most useful commands for removing or modifying commits:
When you run
git rebase -i, Git opens a todo list where each commit is prefixed with a command. These are the commands you can use (aliases in parentheses):# After saving & exiting the editor, Git pauses here. You then:
git add <files>
git commit --amend
git rebase --continue
Then let's say we would like to make further modification
-----
pick a1b2c3d Add user auth
fixup e4f5g6h Typo in auth
reword i7j8k9l Update README
edit m0n1o2p Refactor login
drop q3r4s5t Debug console.log
To move on the the next stage: Use git rebase --continue, --skip, or --abort as needed.
Comments