Remote tracking option hint for git-switch still shows git-checkout command
- From
- Simon 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