Last active
April 29, 2022 16:58
-
-
Save guilt/233ec48810116457fccc3085eed4f211 to your computer and use it in GitHub Desktop.
git-squash
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
#!/bin/sh | |
N=${1:-2} | |
git reset --soft HEAD~$N && | |
git commit --edit -m"$(git log --format=%B --reverse HEAD..HEAD@{1})" |
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
#!/bin/sh | |
N=${1:-2} | |
git reset --soft HEAD~$N |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment