Git history
Interact Mode¶
with -i command, git will open default editior interface
change pick syntax to reword, save and exit
then, the changed commit will be edited by default editior
notice that changing the commit messages will also change the SHA-1 value of commit
Combine multiple commit¶
use rebase with -i can also combine multiple commit
pick to squash will squish commits with prvious one
Split one commit into multiple one¶
just use git reset to split commit
Add commit between commit¶
first, rebase to the commit want to change
changepick to edit modify commit
then, after fixing commit, use continue
Delete specific commit or change sequence of commit¶
simply edit sequence in git rebase -i editor
with delete, we could use drop syntax or simply delete specific line
Revert¶
add another commit to remove previous one