Created
May 25, 2020 10:23
-
-
Save donalod/c9b0c276fb4ac0b1a79e38d9997dadaa to your computer and use it in GitHub Desktop.
Squash Current Git Commits
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
#!/usr/bin/env bash | |
echo -e "Squashing last commits since push...\n" | |
git reset --soft HEAD~$(git log @{u}.. | grep -i commit | wc -l | tr -d ' ') && git commit -am "$1" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment