Add stash diff and patch commands

This commit is contained in:
James Skemp 2022-01-09 18:58:52 -06:00
parent f76ef5589c
commit 7a0f223355
1 changed files with 9 additions and 0 deletions

View File

@ -21,6 +21,15 @@ git stash show 'stash@{0}'
# Show individual changes in a particular stash.
git stash show -p 'stash@{0}'
# Show stashed changes in individual file.
git diff ..stash -- <file>
# Create a patch file from the above.
git diff ..stash -- <file> > name.patch
# Apply stashed changes in an individual file.
git diff ..stash -- <file> | git apply
# Apply changes from the last stash. Keep the stash.
git stash apply
git stash apply 'stash@{0}'