git rebase -i HEAD~5(5 or however many commits you had, differing from master)
- Put the cursor highlight on the SECOND commit using your arrow keys.
- To enable visual block, do
CRTL + V
- Use DOWN arrow keys to highlight
pickfor each commit (not including the commit you want to squash the other commits into).
ffor fixup (or
squash- this depends on the command you want to use)
- Exit visual mode by pressing
- When you do
:wqto exit Vim, the
fixups will be filled in for you automatically, removing the need to do it manually for each commit.
More reading: Atlassian Git Rebase