Back
Syntax
Study
Editor
Mode:
HTML
CSS
JavaScript
PHP
Reset
Run »
HTML / CSS / JS
# Interactively edit the last 4 commits: git rebase -i HEAD~4 # Git opens your editor with a list like: # pick a1b2c3 Add login form # pick d4e5f6 Fix typo # pick g7h8i9 WIP: more login work # pick j1k2l3 Finish login feature # Change 'pick' to one of these commands: # pick — keep as-is # reword — keep, but edit the commit message # edit — pause rebase to amend the commit # squash — merge into the PREVIOUS commit (keeps both messages) # fixup — like squash, but discard this commit's message # drop — remove the commit entirely # Example: squash 4 commits into 1: # pick a1b2c3 Add login form # squash d4e5f6 Fix typo # squash g7h8i9 WIP: more login work # squash j1k2l3 Finish login feature # Save and close the editor. # Git opens another editor to write the combined message. # After interactive rebase on a pushed branch: git push --force-with-lease origin feature/login # Squash all feature branch commits at merge time: git merge --squash feature/login git commit -m "feat: add user login"
Result
Open