doc: checkout: synchronize <pathspec> description
`git add` shows an example of good writing, follow it. Signed-off-by: Alexandr Miloslavskiy <alexandr.miloslavskiy@syntevo.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Alexandr Miloslavskiy committed
Dec 3, 2019 at 14:02 UTC
8ea1189eacab039fec58b0616bc814d5c03301f8
1 file changed
+15
-9
Documentation/git-checkout.txt
+15
-9
@@ -12,13 +12,13 @@ SYNOPSIS
12
'git checkout' [-q] [-f] [-m] --detach [<branch>]
13
'git checkout' [-q] [-f] [-m] [--detach] <commit>
14
'git checkout' [-q] [-f] [-m] [[-b|-B|--orphan] <new_branch>] [<start_point>]
15
-'git checkout' [-f|--ours|--theirs|-m|--conflict=<style>] [<tree-ish>] [--] <paths>...
16
-'git checkout' (-p|--patch) [<tree-ish>] [--] [<paths>...]
15
+'git checkout' [-f|--ours|--theirs|-m|--conflict=<style>] [<tree-ish>] [--] <pathspec>...
16
+'git checkout' (-p|--patch) [<tree-ish>] [--] [<pathspec>...]
17
18
DESCRIPTION
19
-----------
20
Updates files in the working tree to match the version in the index
21
-or the specified tree. If no paths are given, 'git checkout' will
21
+or the specified tree. If no pathspec was given, 'git checkout' will
22
also update `HEAD` to set the specified branch as the current
23
branch.
24
@@ -78,13 +78,13 @@ be used to detach `HEAD` at the tip of the branch (`git checkout
78
+
79
Omitting `<branch>` detaches `HEAD` at the tip of the current branch.
80
81
-'git checkout' [-f|--ours|--theirs|-m|--conflict=<style>] [<tree-ish>] [--] <paths>...::
81
+'git checkout' [-f|--ours|--theirs|-m|--conflict=<style>] [<tree-ish>] [--] <pathspec>...::
82
83
- Overwrite paths in the working tree by replacing with the
84
- contents in the index or in the `<tree-ish>` (most often a
85
- commit). When a `<tree-ish>` is given, the paths that
86
- match the `<pathspec>` are updated both in the index and in
87
- the working tree.
83
+ Overwrite the contents of the files that match the pathspec.
84
+ When the `<tree-ish>` (most often a commit) is not given,
85
+ overwrite working tree with the contents in the index.
86
+ When the `<tree-ish>` is given, overwrite both the index and
87
+ the working tree with the contents at the `<tree-ish>`.
88
+
89
The index may contain unmerged entries because of a previous failed merge.
90
By default, if you try to check out such an entry from the index, the
@@ -336,7 +336,13 @@ leave out at most one of `A` and `B`, in which case it defaults to `HEAD`.
336
Tree to checkout from (when paths are given). If not specified,
337
the index will be used.
338
339
+\--::
340
+ Do not interpret any more arguments as options.
341
342
+<pathspec>...::
343
+ Limits the paths affected by the operation.
344
++
345
+For more details, see the 'pathspec' entry in linkgit:gitglossary[7].
346
347
DETACHED HEAD
348
-------------