{"thread":{"id":"66761","subject":"[PATCH] branch doc: consistently promote 'switch'","startedAt":"2026-11-03T21:58:52Z","lastAt":"2026-11-04T17:52:34Z","messageCount":2,"participants":["Junio C Hamano","Ben Knoble"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"557383","messageId":"xmqqwlqt4lwj.fsf@gitster.g","threadId":"66761","inReplyTo":null,"subject":"[PATCH] branch doc: consistently promote 'switch'","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-11-03T21:58:52Z","receivedAt":"2026-11-03T21:58:52Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"When 328c6cb853 (doc: promote \"git switch\", 2019-03-29) updated an\nexample in git-branch documentation, it made an inconsistent change\nto turn \"git checkout my2.6.14\" command in an example into \"git\nswitch my2.6.14\", without updating a comment that talks about a\nshorthand to create and checkout the newly created branch at the\nsame time, which still talked about \"checkout -b <new> <start>\".\n\nUpdate the latter to talk about \"git switch -c\" for consistency.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n\n * An alternative would be to list both \"git checkout -b\" and \"git\n   switch -c\", as \"git checkout\" is not going away (for the purpose\n   of *replacing* checkout, the switch/restore were a failed\n   experiment, even though they gained enough users to stay).\n\n Documentation/git-branch.adoc | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git c/Documentation/git-branch.adoc w/Documentation/git-branch.adoc\nindex bfdf459329..a803c24858 100644\n--- c/Documentation/git-branch.adoc\n+++ w/Documentation/git-branch.adoc\n@@ -406,17 +406,17 @@ Start development from a known tag::\n ------------\n $ git clone git://git.kernel.org/pub/scm/.../linux-2.6 my2.6\n $ cd my2.6\n $ git branch my2.6.14 v2.6.14   <1>\n $ git switch my2.6.14\n ------------\n +\n <1> This step and the next one could be combined into a single step with\n-    \"checkout -b my2.6.14 v2.6.14\".\n+    \"git switch -c my2.6.14 v2.6.14\".\n \n Delete an unneeded branch::\n +\n ------------\n $ git clone git://git.kernel.org/.../git.git my.git\n $ cd my.git\n $ git branch -d -r origin/todo origin/html origin/man   <1>\n $ git branch -D test                                    <2>\n\n"},{"id":"557473","messageId":"6EBBE956-4824-4398-B33D-F4E5F58040D1@gmail.com","threadId":"66761","inReplyTo":"xmqqwlqt4lwj.fsf@gitster.g","subject":"Re: [PATCH] branch doc: consistently promote 'switch'","fromName":"Ben Knoble","fromEmail":"ben.knoble@gmail.com","sentAt":"2026-11-04T17:52:34Z","receivedAt":"2026-11-04T17:52:34Z","isPatch":true,"sender":{"key":"ben.knoble@gmail.com","avatar":"https://avatars.githubusercontent.com/u/22802209?v=4"},"body":"\n> Le 3 nov. 2026 à 16:59, Junio C Hamano <gitster@pobox.com> a écrit :\n> \n> ﻿When 328c6cb853 (doc: promote \"git switch\", 2019-03-29) updated an\n> example in git-branch documentation, it made an inconsistent change\n> to turn \"git checkout my2.6.14\" command in an example into \"git\n> switch my2.6.14\", without updating a comment that talks about a\n> shorthand to create and checkout the newly created branch at the\n> same time, which still talked about \"checkout -b <new> <start>\".\n> \n> Update the latter to talk about \"git switch -c\" for consistency.\n> \n> Signed-off-by: Junio C Hamano <gitster@pobox.com>\n> ---\n> \n> * An alternative would be to list both \"git checkout -b\" and \"git\n>   switch -c\", as \"git checkout\" is not going away (for the purpose\n>   of *replacing* checkout, the switch/restore were a failed\n>   experiment, even though they gained enough users to stay).\n> \n> Documentation/git-branch.adoc | 2 +-\n> 1 file changed, 1 insertion(+), 1 deletion(-)\n> \n> diff --git c/Documentation/git-branch.adoc w/Documentation/git-branch.adoc\n> index bfdf459329..a803c24858 100644\n> --- c/Documentation/git-branch.adoc\n> +++ w/Documentation/git-branch.adoc\n> @@ -406,17 +406,17 @@ Start development from a known tag::\n> ------------\n> $ git clone git://git.kernel.org/pub/scm/.../linux-2.6 my2.6\n> $ cd my2.6\n> $ git branch my2.6.14 v2.6.14   <1>\n> $ git switch my2.6.14\n> ------------\n> +\n> <1> This step and the next one could be combined into a single step with\n> -    \"checkout -b my2.6.14 v2.6.14\".\n> +    \"git switch -c my2.6.14 v2.6.14\".\n> \n> Delete an unneeded branch::\n> +\n> ------------\n> $ git clone git://git.kernel.org/.../git.git my.git\n> $ cd my.git\n> $ git branch -d -r origin/todo origin/html origin/man   <1>\n> $ git branch -D test                                    <2>\n\nAll sensible to me. \n\nFWIW, the more folks I teach about switch the more folks tell me they have,\nahem, switched. And prefer it!\n"}]}