Skip to content

Commit

Permalink
git-stash.txt: better docs for '--patch'
Browse files Browse the repository at this point in the history
Describe '-p' as a short form of '--patch' in synopsis and options.  Also
refer the reader to the patch mode description of git-add documentation.

Helped-by: Jeff King <peff@peff.net>
Mentored-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Valentin Haenel <valentin.haenel@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Valentin Haenel authored and Junio C Hamano committed May 5, 2011
1 parent c105356 commit f2808a5
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Documentation/git-stash.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 [--patch] [-k|--[no-]keep-index] [-q|--quiet] [<message>]]
'git stash' [save [-p|--patch] [-k|--[no-]keep-index] [-q|--quiet] [<message>]]
'git stash' clear
'git stash' create

Expand Down Expand Up @@ -42,7 +42,7 @@ is also possible).
OPTIONS
-------

save [--patch] [--[no-]keep-index] [-q|--quiet] [<message>]::
save [-p|--patch] [--[no-]keep-index] [-q|--quiet] [<message>]::

Save your local modifications to a new 'stash', and run `git reset
--hard` to revert them. The <message> part is optional and gives
Expand All @@ -54,12 +54,13 @@ save [--patch] [--[no-]keep-index] [-q|--quiet] [<message>]::
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
With `--patch`, you can interactively select hunks from 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.
from your worktree. See the ``Interactive Mode'' section of
linkgit:git-add[1] to learn how to operate the `\--patch` mode.
+
The `--patch` option implies `--keep-index`. You can use
`--no-keep-index` to override this.
Expand Down

0 comments on commit f2808a5

Please sign in to comment.