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

Remote tracking option hint for git-switch still shows git-checkout command

From
SCSimon Cheng <cyqsimon@gmail.com>
Date
Jan 27, 2026, 09:31 UTC
Message-ID
<CA+itcS0iyqNyzOP0cueLg7B3yadoEr_VWJ-QoL+YPFUPJiE2RQ@mail.gmail.com>

When `git-switch my-branch` is unable to guess a unique remote tracking branch, the shown hint still displays an example with the `git-checkout` command.

❯ git switch my-branch hint: If you meant to check out a remote tracking branch on, e.g. 'origin', hint: you can do so by fully qualifying the name with the --track option: hint: hint: git checkout --track origin/<name> hint: hint: If you'd like to always have checkouts of an ambiguous <name> prefer hint: one remote, e.g. the 'origin' remote, consider setting hint: checkout.defaultRemote=origin in your config. fatal: 'my-branch' matched multiple (2) remote tracking branches

Of course that works too, but it keeps the user guessing whether the `--track` option also exists for `git-switch`. Not to mention that `git-checkout` is now largely superseded by `git-switch` and `git-restore` and is no longer recommended, as far as I understand it.

So I think it makes sense to either:
1. make the recommended command match the one ran by the user, or
2. always recommend `git-switch` as opposed to `git-checkout`
git version 2.52.0
cpu: x86_64
built from commit: 9a2fb147f2c61d0cab52c883e7e26f5b7948e3ed
sizeof-long: 8
sizeof-size_t: 8
shell-path: /bin/sh
rust: enabled
libcurl: 8.17.0
OpenSSL: OpenSSL 3.6.0 1 Oct 2025
zlib-ng: 2.2.5
SHA-1: SHA1_DC
SHA-256: SHA256_BLK
default-ref-format: files
default-hash: sha1
Next: Junio C Hamano
Message 1 of 2 in “Remote tracking option hint for git-switch still shows git-checkout command”
  1. Simon ChengJan 27, 2026
  2. Junio C HamanoJan 27, 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.