Skip to content

Instantly share code, notes, and snippets.

@dineshpanda
Created July 12, 2021 14:02
Show Gist options
  • Save dineshpanda/7dc5aec292b7d24069cb3818015ce5dc to your computer and use it in GitHub Desktop.
Save dineshpanda/7dc5aec292b7d24069cb3818015ce5dc to your computer and use it in GitHub Desktop.
Squash commits keeping commit messages
git reset --soft HEAD~n && git commit --edit -m"$(git log --format=%B --reverse HEAD..HEAD@{1})"
* n is the number of commits you want to squash from HEAD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment