Created
January 22, 2014 20:09
-
-
Save waffle2k/8566431 to your computer and use it in GitHub Desktop.
Place this in your $PATH, then you'll be able to quickly rebase N number of commits with "git squash N"
This file contains hidden or 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/bash | |
# | |
# This is just a wrapper for : git rebase -i HEAD~4 | |
BACK=$1 | |
function die { | |
echo "$1" | |
exit 1 | |
} | |
if [ -z $1 ]; then | |
die 'You must specify an integer, representing the number of commits to squash' | |
fi | |
echo $BACK | egrep -q -e '^[0-9]+$' || die 'Supplied arg is not an integer value' | |
git rebase -i HEAD~${BACK} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment