Created
June 11, 2014 11:51
-
-
Save masak/644702118d2798e890de to your computer and use it in GitHub Desktop.
A git-edit-commit subcommand
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
COMMIT="$1" | |
echo "${COMMIT:=HEAD}" | |
OLD_HEAD=`git rev-parse HEAD` | |
git reset --hard $COMMIT | |
git reset --mixed HEAD~ | |
git commit --patch || (git reset --hard $OLD_HEAD && exit) | |
git checkout . | |
git rebase -X theirs $OLD_HEAD |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment