Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Abhishek12345679/11bc0536e1b93193e98e18b3c2401f58 to your computer and use it in GitHub Desktop.
Save Abhishek12345679/11bc0536e1b93193e98e18b3c2401f58 to your computer and use it in GitHub Desktop.
rebase messy branch
# create a new branch
git checkout -b new_clean_branch
# apply all changes
git merge original_messy_branch
# forget the commits but have the changes staged for commit
git reset --soft main
git commit -m "Squashed changes from original_messy_branch"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment