Rewriting Commit History with Interactive Rebase
Scenario
Modifying or Reordering Commits
Step 1: Starting the Interactive Rebase
git rebase -i HEAD~nStep 2: Interactive Rebase Editor
pick abcd123 Commit 1: Fix typo in README
pick efgh456 Commit 2: Refactor code for performance
pick ijkl789 Commit 3: Add new featureStep 3: Modifying Commits
edit abcd123 Commit 1: Fix typo in READMEStep 4: Modifying the Selected Commit
Step 5: Continuing the Rebase Process
Step 6: Reordering Commits
Step 7: Squashing Commits
Step 8: Addressing Considerations and Best Practices
Last updated