Skip to content

Commit fedb8ea

Browse files
committed
checkout: document -b/-B to highlight the differences from "git branch"
The existing text read as if "git checkout -b/-B name" were equivalent to "git branch [-f] name", which clearly was not what we wanted to say. Signed-off-by: Junio C Hamano <[email protected]>
1 parent 37537d6 commit fedb8ea

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

Documentation/git-checkout.txt

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -146,14 +146,16 @@ on your side branch as `theirs` (i.e. "one contributor's work on top
146146
of it").
147147

148148
-b <new-branch>::
149-
Create a new branch named `<new-branch>` and start it at
150-
`<start-point>`; see linkgit:git-branch[1] for details.
149+
Create a new branch named `<new-branch>`, start it at
150+
`<start-point>`, and check the resulting branch out;
151+
see linkgit:git-branch[1] for details.
151152

152153
-B <new-branch>::
153-
Creates the branch `<new-branch>` and start it at `<start-point>`;
154-
if it already exists, then reset it to `<start-point>`. This is
155-
equivalent to running "git branch" with "-f"; see
156-
linkgit:git-branch[1] for details.
154+
Creates the branch `<new-branch>`, start it at `<start-point>`;
155+
if it already exists, then reset it to `<start-point>`. And then
156+
check the resulting branch out. This is equivalent to running
157+
"git branch" with "-f" followed by "git checkout" of that branch;
158+
see linkgit:git-branch[1] for details.
157159

158160
-t::
159161
--track[=(direct|inherit)]::

0 commit comments

Comments
 (0)