Last active
October 7, 2015 16:47
-
-
Save vifon/3195561 to your computer and use it in GitHub Desktop.
git fixup
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 | |
# USAGE: git fixup [commit hash or something] | |
# Adds the staged changes to the specified commit. | |
if [ -n "$1" ]; then | |
git stash --keep-index | |
git commit --fixup="$1" && | |
GIT_EDITOR=vim git rebase --autosquash --interactive "$1~1" | |
git stash pop | |
else | |
echo "Missing argument" 1>&2 | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment