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 <gitster@pobox.com>
Junio C Hamano committed
Jan 19, 2023 at 09:12 UTC
fedb8ea2df0325950285529b6e9e3f65cb227c67
1 file changed
+8
-6
Documentation/git-checkout.txt
+8
-6
@@ -146,14 +146,16 @@ on your side branch as `theirs` (i.e. "one contributor's work on top
146
of it").
147
148
-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.
152
153
-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.
159
160
-t::
161
--track[=(direct|inherit)]::