Skip to content

Commit

Permalink
Merge branch 'jc/doc-checkout-b'
Browse files Browse the repository at this point in the history
Clarify how "checkout -b/-B" and "git branch [-f]" are similar but
different in the documentation.

* jc/doc-checkout-b:
  checkout: document -b/-B to highlight the differences from "git branch"
  • Loading branch information
gitster committed Jan 30, 2023
2 parents 5cc9858 + fedb8ea commit 06f2b5f
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions Documentation/git-checkout.txt
Expand Up @@ -146,14 +146,16 @@ on your side branch as `theirs` (i.e. "one contributor's work on top
of it").

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

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

-t::
--track[=(direct|inherit)]::
Expand Down

0 comments on commit 06f2b5f

Please sign in to comment.