@@ -15,26 +15,32 @@ SYNOPSIS
15
15
16
16
DESCRIPTION
17
17
-----------
18
+ Retrieves files from the index or specified tree and writes them
19
+ to the working tree.
18
20
19
- When <paths> are not given, this command switches branches by
20
- updating the index, working tree, and HEAD to reflect the specified
21
- branch.
21
+ 'git checkout' [-b <new branch>] [<branch>]::
22
22
23
+ When <paths> are not given, this command switches branches by
24
+ updating the index, working tree, and HEAD to reflect the
25
+ specified branch.
26
+ +
23
27
If `-b` is given, a new branch is created and checked out, as if
24
28
linkgit:git-branch[1] were called; in this case you can
25
29
use the --track or --no-track options, which will be passed to `git
26
30
branch`. As a convenience, --track without `-b` implies branch
27
31
creation; see the description of --track below.
28
32
29
- When <paths> or --patch are given, this command does *not* switch
30
- branches. It updates the named paths in the working tree from
31
- the index file, or from a named <tree-ish> (most often a commit). In
32
- this case, the `-b` and `--track` options are meaningless and giving
33
- either of them results in an error. The <tree-ish> argument can be
34
- used to specify a specific tree-ish (i.e. commit, tag or tree)
35
- to update the index for the given paths before updating the
36
- working tree.
33
+ 'git checkout' [--patch] [<tree-ish>] [--] [<pathspec>...]::
37
34
35
+ When <paths> or --patch are given, this command does *not* switch
36
+ branches. It updates the named paths in the working tree from
37
+ the index file, or from a named <tree-ish> (most often a commit). In
38
+ this case, the `-b` and `--track` options are meaningless and giving
39
+ either of them results in an error. The <tree-ish> argument can be
40
+ used to specify a specific tree-ish (i.e. commit, tag or tree)
41
+ to update the index for the given paths before updating the
42
+ working tree.
43
+ +
38
44
The index may contain unmerged entries after a failed merge. By
39
45
default, if you try to check out such an entry from the index, the
40
46
checkout operation will fail and nothing will be checked out.
0 commit comments