Created
July 12, 2021 14:02
-
-
Save dineshpanda/7dc5aec292b7d24069cb3818015ce5dc to your computer and use it in GitHub Desktop.
Squash commits keeping commit messages
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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