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

git-switch history and checkout compatibility

From
NMNamikaze Minato <lloydsensei+git@gmail.com>
Date
Jun 28, 2023, 13:03 UTC
Message-ID
<CACmJb3xWh+0BR_V6sxfMK7iMSdWfvY9d2rjt1hnZhFw70zWweA@mail.gmail.com>
In-Reply-To
<CACmJb3yoHagaU1wb4qRT-nZV4Wptao8boaUXCAYrFxfrxcmUYg@mail.gmail.com>
Hello,
I have been waiting for people to report this but it never came so I'm doing it:

I have trouble with getting used to git-switch instead of git-checkout, but have even more trouble to get people to adopt it.

Please consider the two following git-switch statements:

git switch remote/branch # fatal: a branch is expected, got remote branch 'remote/branch' #and git switch -d remote/branch git switch master git switch - # fatal: a branch is expected, got commit 'commit_id_here'

Both as retro-compatibility with checkout and for user-friendliness, I would expect both to work. Maybe a setting checkout.autoDetach could control such behavior if the current implementation should be kept?

What do you think?

Kind regards, Minato

Next: Junio C Hamano
Message 1 of 4 in “git-switch history and checkout compatibility”
  1. Namikaze MinatoJun 28, 2023
  2. Junio C HamanoJun 28, 2023
  3. Namikaze MinatoAug 1, 2023
  4. Junio C HamanoAug 1, 2023

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.