Squash and clean up a feature branch
Walk through squashing a messy feature branch into a clean commit history with interactive rebase, a good final message, and a safe force-push.
Preview
Copy prompt
I have a feature branch with [N] commits that includes work-in-progress saves, typo fixes, and debug commits that I want to clean up into a clear, logical commit history before opening a pull request. Walk me through the trade-offs between interactive rebase with squash/fixup and merge --squash. Show the exact commands for the approach you recommend. Explain how to write a high-quality final commit message using the Conventional Commits format. Describe how to handle rebase conflicts if they arise. Explain when and how to safely force-push the cleaned-up branch.
More
Git & Version Control
Prompts
