@matheusbsbs / matheus-bagliano / commits / 76cfadfc17
Fork 0

doc/checkout: split checkout and branch creation in synopsis

These can really be thought of as two different modes, since the "<branch>" parameter is treated differently in the two (in one it is the branch to be checked out, but in the other it is really a start-point for branch creation). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jeff King committed Apr 13, 2009 at 07:19 UTC 76cfadfc17e9e9c7da87a6f9a4710c04107ae0cd
1 file changed +22 -18
Documentation/git-checkout.txt
+22 -18
@@ -8,23 +8,22 @@ git-checkout - Checkout a branch or paths to the working tree
8 SYNOPSIS
9 --------
10 [verse]
11 -'git checkout' [-q] [-f] [-m] [-b <new_branch>] [<branch>]
11 +'git checkout' [-q] [-f] [-m] [<branch>]
12 +'git checkout' [-q] [-f] [-m] [-b <new_branch>] [<start_point>]
13 'git checkout' [-f|--ours|--theirs|-m|--conflict=<style>] [<tree-ish>] [--] <paths>...
14
15 DESCRIPTION
16 -----------
17
18 When <paths> are not given, this command switches branches by
18 -updating the index and working tree to reflect the specified
19 -branch, <branch>, and updating HEAD to be <branch> or, if
20 -specified, <new_branch>. Using -b will cause <new_branch> to
21 -be created as if linkgit:git-branch[1] were called; in this case you can
22 -use the --track or --no-track options, which will be passed to `git
23 -branch`.
19 +updating the index, working tree, and HEAD to reflect the specified
20 +branch.
21
25 -As a convenience, --track will default to creating a branch whose
26 -name is constructed from the specified branch name by stripping
27 -the first namespace level.
22 +If `-b` is given, a new branch is created and checked out, as if
23 +linkgit:git-branch[1] were called; in this case you can
24 +use the --track or --no-track options, which will be passed to `git
25 +branch`. As a convenience, --track without `-b` implies branch
26 +creation; see the description of --track below.
27
28 When <paths> are given, this command does *not* switch
29 branches. It updates the named paths in the working tree from
@@ -63,7 +62,7 @@ entries; instead, unmerged entries are ignored.
62
63 -b::
64 Create a new branch named <new_branch> and start it at
66 - <branch>; see linkgit:git-branch[1] for details.
65 + <start_point>; see linkgit:git-branch[1] for details.
66
67 -t::
68 --track::
@@ -114,13 +113,6 @@ the conflicted merge in the specified paths.
113 "merge" (default) and "diff3" (in addition to what is shown by
114 "merge" style, shows the original contents).
115
117 -<new_branch>::
118 - Name for the new branch.
119 -
120 -<tree-ish>::
121 - Tree to checkout from (when paths are given). If not specified,
122 - the index will be used.
123 -
116 <branch>::
117 Branch to checkout (when no paths are given); may be any object
118 ID that resolves to a commit. Defaults to HEAD.
@@ -132,6 +124,18 @@ As a special case, the `"@\{-N\}"` syntax for the N-th last branch
124 checks out the branch (instead of detaching). You may also specify
125 `-` which is synonymous with `"@\{-1\}"`.
126
127 +<new_branch>::
128 + Name for the new branch.
129 +
130 +<start_point>::
131 + The name of a commit at which to start the new branch; see
132 + linkgit:git-branch[1] for details. Defaults to HEAD.
133 +
134 +<tree-ish>::
135 + Tree to checkout from (when paths are given). If not specified,
136 + the index will be used.
137 +
138 +
139
140 Detached HEAD
141 -------------