git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [RFC] git branch: add -s/--switch to create and switch to a new branch

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 3, 2026, 19:46 UTC
Message-ID
<xmqq7bit7l68.fsf@gitster.g>
In-Reply-To
<CA++gwosYFaOLD5nZjKUUFtp1ryezikqAsD6vu=uqBzOwyszASw@mail.gmail.com>
Johannes Welsch <johannes.welsch@googlemail.com> writes:
> I'd like to propose adding a -s (--switch) option to `git branch`.
>
> It makes sense semantically to create a branch and to also switch to it.

Why is "git checkout -b <new-branch-name> [<where-the-branch-begins]" not sufficient?

Previous: Pushkar Singh
Message 3 of 3 in “[RFC] git branch: add -s/--switch to create and switch to a new branch”
  1. Johannes WelschNov 3, 2026
  2. Pushkar SinghNov 3, 2026
  3. Junio C HamanoNov 3, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.