Skip to content

Commit a31538e

Browse files
escgitster
authored andcommitted
git-checkout.txt: better docs for '--patch'
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 <[email protected]> Mentored-by: Junio C Hamano <[email protected]> Signed-off-by: Valentin Haenel <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent f2808a5 commit a31538e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Documentation/git-checkout.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ SYNOPSIS
1212
'git checkout' [-q] [-f] [-m] [--detach] [<commit>]
1313
'git checkout' [-q] [-f] [-m] [[-b|-B|--orphan] <new_branch>] [<start_point>]
1414
'git checkout' [-f|--ours|--theirs|-m|--conflict=<style>] [<tree-ish>] [--] <paths>...
15-
'git checkout' --patch [<tree-ish>] [--] [<paths>...]
15+
'git checkout' [-p|--patch] [<tree-ish>] [--] [<paths>...]
1616

1717
DESCRIPTION
1818
-----------
@@ -45,7 +45,7 @@ $ git checkout <branch>
4545
that is to say, the branch is not reset/created unless "git checkout" is
4646
successful.
4747

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

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

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

0 commit comments

Comments
 (0)