Git development
 help / color / mirror / Atom feed
From: Ben Knoble <ben.knoble@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] branch doc: consistently promote 'switch'
Date: Wed, 4 Nov 2026 12:52:34 -0500	[thread overview]
Message-ID: <6EBBE956-4824-4398-B33D-F4E5F58040D1@gmail.com> (raw)
In-Reply-To: <xmqqwlqt4lwj.fsf@gitster.g>


> Le 3 nov. 2026 à 16:59, Junio C Hamano <gitster@pobox.com> a écrit :
> 
> When 328c6cb853 (doc: promote "git switch", 2019-03-29) updated an
> example in git-branch documentation, it made an inconsistent change
> to turn "git checkout my2.6.14" command in an example into "git
> switch my2.6.14", without updating a comment that talks about a
> shorthand to create and checkout the newly created branch at the
> same time, which still talked about "checkout -b <new> <start>".
> 
> Update the latter to talk about "git switch -c" for consistency.
> 
> Signed-off-by: Junio C Hamano <gitster@pobox.com>
> ---
> 
> * An alternative would be to list both "git checkout -b" and "git
>   switch -c", as "git checkout" is not going away (for the purpose
>   of *replacing* checkout, the switch/restore were a failed
>   experiment, even though they gained enough users to stay).
> 
> Documentation/git-branch.adoc | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git c/Documentation/git-branch.adoc w/Documentation/git-branch.adoc
> index bfdf459329..a803c24858 100644
> --- c/Documentation/git-branch.adoc
> +++ w/Documentation/git-branch.adoc
> @@ -406,17 +406,17 @@ Start development from a known tag::
> ------------
> $ git clone git://git.kernel.org/pub/scm/.../linux-2.6 my2.6
> $ cd my2.6
> $ git branch my2.6.14 v2.6.14   <1>
> $ git switch my2.6.14
> ------------
> +
> <1> This step and the next one could be combined into a single step with
> -    "checkout -b my2.6.14 v2.6.14".
> +    "git switch -c my2.6.14 v2.6.14".
> 
> Delete an unneeded branch::
> +
> ------------
> $ git clone git://git.kernel.org/.../git.git my.git
> $ cd my.git
> $ git branch -d -r origin/todo origin/html origin/man   <1>
> $ git branch -D test                                    <2>

All sensible to me. 

FWIW, the more folks I teach about switch the more folks tell me they have,
ahem, switched. And prefer it!

      reply	other threads:[~2026-11-04 17:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-03 21:58 [PATCH] branch doc: consistently promote 'switch' Junio C Hamano
2026-11-04 17:52 ` Ben Knoble [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6EBBE956-4824-4398-B33D-F4E5F58040D1@gmail.com \
    --to=ben.knoble@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox