Created
January 26, 2018 06:27
-
-
Save LisannaAtHome/269574f53f7bfd71a9a3fdd418c71899 to your computer and use it in GitHub Desktop.
Extracts all the changes from your HEAD commit and unstages them, leaving the commit message in-place (albeit with a different sha, of course), so it's easier to go back and fix the commit with visual diff -enabled editors (since the changes will show up as unstaged, and will usually be colorized).
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
#!/usr/bin/env bash | |
git log --format=%B -n 1 HEAD > ._GIT_EXTRACT_MSG && git reset --soft HEAD^ && git reset HEAD && git commit --allow-empty -F ._GIT_EXTRACT_MSG && rm ._GIT_EXTRACT_MSG |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment