Last active
February 19, 2016 14:42
-
-
Save mkhl/bb8760aeb7772421165c to your computer and use it in GitHub Desktop.
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/sh | |
git add --update -- "$@" | |
git commit --message="trash -- $(date)" -- "$@" | |
git reset --soft HEAD^ | |
git reset --quiet -- "$@" | |
git checkout -- "$@" |
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/sh | |
git add --update -- "$@" | |
git commit --message="trash -- $(date)" -- "$@" | |
git reset --keep HEAD^ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The
-alt
version preserves files added to the index that aren't trashed if you provide arguments. it would be a strict improvement if I can find sensible default arguments. Maybegit rev-parse --show-toplevel
?