Skip to content

Commit

Permalink
git-checkout.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 f2808a5 commit a31538e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Documentation/git-checkout.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ SYNOPSIS
'git checkout' [-q] [-f] [-m] [--detach] [<commit>]
'git checkout' [-q] [-f] [-m] [[-b|-B|--orphan] <new_branch>] [<start_point>]
'git checkout' [-f|--ours|--theirs|-m|--conflict=<style>] [<tree-ish>] [--] <paths>...
'git checkout' --patch [<tree-ish>] [--] [<paths>...]
'git checkout' [-p|--patch] [<tree-ish>] [--] [<paths>...]

DESCRIPTION
-----------
Expand Down Expand Up @@ -45,7 +45,7 @@ $ git checkout <branch>
that is to say, the branch is not reset/created unless "git checkout" is
successful.

'git checkout' [--patch] [<tree-ish>] [--] <pathspec>...::
'git checkout' [-p|--patch] [<tree-ish>] [--] <pathspec>...::

When <paths> or `--patch` are given, 'git checkout' does *not*
switch branches. It updates the named paths in the working tree
Expand Down Expand Up @@ -183,7 +183,8 @@ the conflicted merge in the specified paths.
working tree (and if a <tree-ish> was specified, the index).
+
This means that you can use `git checkout -p` to selectively discard
edits from your current working tree.
edits from your current working tree. See the ``Interactive Mode''
section of linkgit:git-add[1] to learn how to operate the `\--patch` mode.

<branch>::
Branch to checkout; if it refers to a branch (i.e., a name that,
Expand Down

0 comments on commit a31538e

Please sign in to comment.