[PATCH] git-stash.txt: Add new example

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Jari Aalto <jari.aalto@xxxxxxxxx>

Add new example "Saving selected files to stash" thanks to
ideas by Johan Sageryd <j416@xxxxxxx>.

Signed-off-by: Jari Aalto <jari.aalto@xxxxxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]