Created
June 19, 2013 20:10
-
-
Save jeffremer/5817616 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 | |
source "$(git --exec-path)/git-sh-setup" | |
USAGE="COMMITS" | |
function _squash() { | |
if [[ $# == 1 ]]; then | |
if [[ -n $(git rev-parse --verify --quiet HEAD~$1) ]]; then | |
git rebase -i HEAD~$1 | |
else | |
die "HEAD~$1 does not exist" | |
fi | |
else | |
usage | |
fi | |
} | |
_squash $1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment