Skip to content

Commit fd16675

Browse files
committed
doc: checkout: synchronize <pathspec> description
`git add` shows an example of good writing, follow it. Signed-off-by: Alexandr Miloslavskiy <[email protected]>
1 parent a498dda commit fd16675

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

Documentation/git-checkout.txt

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ SYNOPSIS
1212
'git checkout' [-q] [-f] [-m] --detach [<branch>]
1313
'git checkout' [-q] [-f] [-m] [--detach] <commit>
1414
'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>...]
1717

1818
DESCRIPTION
1919
-----------
2020
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
2222
also update `HEAD` to set the specified branch as the current
2323
branch.
2424

@@ -78,13 +78,13 @@ be used to detach `HEAD` at the tip of the branch (`git checkout
7878
+
7979
Omitting `<branch>` detaches `HEAD` at the tip of the current branch.
8080

81-
'git checkout' [-f|--ours|--theirs|-m|--conflict=<style>] [<tree-ish>] [--] <paths>...::
81+
'git checkout' [-f|--ours|--theirs|-m|--conflict=<style>] [<tree-ish>] [--] <pathspec>...::
8282

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>`.
8888
+
8989
The index may contain unmerged entries because of a previous failed merge.
9090
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`.
336336
Tree to checkout from (when paths are given). If not specified,
337337
the index will be used.
338338

339+
\--::
340+
Do not interpret any more arguments as options.
339341

342+
<pathspec>...::
343+
Limits the paths affected by the operation.
344+
+
345+
For more details, see the 'pathspec' entry in linkgit:gitglossary[7].
340346

341347
DETACHED HEAD
342348
-------------

0 commit comments

Comments
 (0)