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