aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/git-stash.txt
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-09-07 15:24:38 -0700
committerJunio C Hamano <gitster@pobox.com>2009-09-07 15:24:38 -0700
commit54f0bdc81103f45f12978b385a9519a235b03cc2 (patch)
treeee239eeafe0f59af72eca683e5e264b0c2a6fff5 /Documentation/git-stash.txt
parent8e4384fd4438a143af7125eb0f03312a318319fb (diff)
parent3c2eb80fe3f3c7efbb25e929df9f70d7c896a5ef (diff)
downloadgit-54f0bdc81103f45f12978b385a9519a235b03cc2.tar.gz
Merge branch 'tr/reset-checkout-patch'
* tr/reset-checkout-patch: stash: simplify defaulting to "save" and reject unknown options Make test case number unique tests: disable interactive hunk selection tests if perl is not available DWIM 'git stash save -p' for 'git stash -p' Implement 'git stash save --patch' Implement 'git checkout --patch' Implement 'git reset --patch' builtin-add: refactor the meat of interactive_add() Add a small patch-mode testing library git-apply--interactive: Refactor patch mode code Make 'git stash -k' a short form for 'git stash save --keep-index'
Diffstat (limited to 'Documentation/git-stash.txt')
-rw-r--r--Documentation/git-stash.txt22
1 files changed, 17 insertions, 5 deletions
diff --git a/Documentation/git-stash.txt b/Documentation/git-stash.txt
index 2f5ca7b1a3..3f14b727b8 100644
--- a/Documentation/git-stash.txt
+++ b/Documentation/git-stash.txt
@@ -13,7 +13,7 @@ SYNOPSIS
'git stash' drop [-q|--quiet] [<stash>]
'git stash' ( pop | apply ) [--index] [-q|--quiet] [<stash>]
'git stash' branch <branchname> [<stash>]
-'git stash' [save [--keep-index] [-q|--quiet] [<message>]]
+'git stash' [save [--patch] [-k|--[no-]keep-index] [-q|--quiet] [<message>]]
'git stash' clear
'git stash' create
@@ -42,15 +42,27 @@ is also possible).
OPTIONS
-------
-save [--keep-index] [-q|--quiet] [<message>]::
+save [--patch] [--[no-]keep-index] [-q|--quiet] [<message>]::
Save your local modifications to a new 'stash', and run `git reset
- --hard` to revert them. This is the default action when no
- subcommand is given. The <message> part is optional and gives
- the description along with the stashed state.
+ --hard` to revert them. The <message> part is optional and gives
+ the description along with the stashed state. For quickly making
+ a snapshot, you can omit _both_ "save" and <message>, but giving
+ only <message> does not trigger this action to prevent a misspelled
+ subcommand from making an unwanted stash.
+
If the `--keep-index` option is used, all changes already added to the
index are left intact.
++
+With `--patch`, you can interactively select hunks from in the diff
+between HEAD and the working tree to be stashed. The stash entry is
+constructed such that its index state is the same as the index state
+of your repository, and its worktree contains only the changes you
+selected interactively. The selected changes are then rolled back
+from your worktree.
++
+The `--patch` option implies `--keep-index`. You can use
+`--no-keep-index` to override this.
list [<options>]::