git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[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
Next: Junio C Hamano
Message 1 of 6 in “git-stash.txt: Add new example”
  1. git-stash.txt: Add new examplejari.aalto@cante.net, May 5, 2010
  2. Junio C HamanoMay 5, 2010
  3. git-stash.txt: Add example "Using stash selectively"Jari Aalto, May 6, 2010
  4. Johannes SixtMay 6, 2010
  5. git-stash.txt: Add example "Using stash selectively"Jari Aalto, May 7, 2010
  6. Junio C HamanoMay 7, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.