@@ -13,7 +13,8 @@ SYNOPSIS
13
13
'git checkout' [-q] [-f] [-m] [--detach] <commit>
14
14
'git checkout' [-q] [-f] [-m] [[-b|-B|--orphan] <new_branch>] [<start_point>]
15
15
'git checkout' [-f|--ours|--theirs|-m|--conflict=<style>] [<tree-ish>] [--] <paths>...
16
- 'git checkout' [-p|--patch] [<tree-ish>] [--] [<paths>...]
16
+ 'git checkout' [<tree-ish>] [--] <pathspec>...
17
+ 'git checkout' (-p|--patch) [<tree-ish>] [--] [<paths>...]
17
18
18
19
DESCRIPTION
19
20
-----------
@@ -78,20 +79,13 @@ be used to detach HEAD at the tip of the branch (`git checkout
78
79
+
79
80
Omitting <branch> detaches HEAD at the tip of the current branch.
80
81
81
- 'git checkout' [-p|--patch] [ <tree-ish>] [--] <pathspec>...::
82
+ 'git checkout' [<tree-ish>] [--] <pathspec>...::
82
83
83
- When <paths> or `--patch` are given, 'git checkout' does *not*
84
- switch branches. It updates the named paths in the working tree
85
- from the index file or from a named <tree-ish> (most often a
86
- commit). In this case, the `-b` and `--track` options are
87
- meaningless and giving either of them results in an error. The
88
- <tree-ish> argument can be used to specify a specific tree-ish
89
- (i.e. commit, tag or tree) to update the index for the given
90
- paths before updating the working tree.
91
- +
92
- 'git checkout' with <paths> or `--patch` is used to restore modified or
93
- deleted paths to their original contents from the index or replace paths
94
- with the contents from a named <tree-ish> (most often a commit-ish).
84
+ Overwrite paths in the working tree by replacing with the
85
+ contents in the index or in the <tree-ish> (most often a
86
+ commit). When a <tree-ish> is given, the paths that
87
+ match the <pathspec> are updated both in the index and in
88
+ the working tree.
95
89
+
96
90
The index may contain unmerged entries because of a previous failed merge.
97
91
By default, if you try to check out such an entry from the index, the
@@ -101,6 +95,14 @@ specific side of the merge can be checked out of the index by
101
95
using `--ours` or `--theirs`. With `-m`, changes made to the working tree
102
96
file can be discarded to re-create the original conflicted merge result.
103
97
98
+ 'git checkout' (-p|--patch) [<tree-ish>] [--] [<pathspec>...]::
99
+ This is similar to the "check out paths to the working tree
100
+ from either the index or from a tree-ish" mode described
101
+ above, but lets you use the interactive interface to show
102
+ the "diff" output and choose which hunks to use in the
103
+ result. See below for the description of `--patch` option.
104
+
105
+
104
106
OPTIONS
105
107
-------
106
108
-q::
0 commit comments