[PATCH] git-stash.txt: Add new example
- From
jari.aalto@cante.net <jari.aalto@cante.net>
- Date
- May 5, 2010, 07:37 UTC
- Message-ID
- <1273045035-7292-1-git-send-email-jari.aalto@cante.net>
From: Jari Aalto <jari.aalto@cante.net>
Add new example "Saving selected files to stash" thanks to ideas by Johan Sageryd <j416@1616.se>.
Signed-off-by: Jari Aalto <jari.aalto@cante.net> --- Documentation/git-stash.txt | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/Documentation/git-stash.txt b/Documentation/git-stash.txt index 473889a..7d9f9e1 100644 --- a/Documentation/git-stash.txt +++ b/Documentation/git-stash.txt @@ -230,6 +230,18 @@ $ edit/build/test remaining parts $ git commit foo -m 'Remaining parts' ---------------------------------------------------------------- +Saving selected files to stash:: + +You can use `git stash save --keep-index` to put only selected files +into the stash. Let's suppose the files A, B, C and D are modified and +you want to stash only C and D: ++ +---------------------------------------------------------------- +$ git status # Verify what's modified +$ git add A B # ...not these +$ git stash save --keep-index # ...but stash all the others +---------------------------------------------------------------- + Recovering stashes that were cleared/dropped erroneously:: If you mistakenly drop or clear stashes, they cannot be recovered
-- 1.7.0