@@ -15,26 +15,32 @@ SYNOPSIS
1515
1616DESCRIPTION
1717-----------
18+ Retrieves files from the index or specified tree and writes them
19+ to the working tree.
1820
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>]::
2222
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+ +
2327If `-b` is given, a new branch is created and checked out, as if
2428linkgit:git-branch[1] were called; in this case you can
2529use the --track or --no-track options, which will be passed to `git
2630branch`. As a convenience, --track without `-b` implies branch
2731creation; see the description of --track below.
2832
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>...]::
3734
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+ +
3844The index may contain unmerged entries after a failed merge. By
3945default, if you try to check out such an entry from the index, the
4046checkout operation will fail and nothing will be checked out.
0 commit comments