switch: mention the --detach option when dying due to lack of a branch
commit808213ba36ea72408cc45117a825ad9a714535ba
authorAlex Henrie <alexhenrie24@gmail.com>
Sat, 26 Feb 2022 06:12:13 +0000 (25 23:12 -0700)
committerJunio C Hamano <gitster@pobox.com>
Sat, 26 Feb 2022 06:21:48 +0000 (25 22:21 -0800)
tree46ce0e0ac916122d22dfe7ddd552c36beff5714d
parentdab1b7905d0b295f1acef9785bb2b9cbb0fdec84
switch: mention the --detach option when dying due to lack of a branch

Users who are accustomed to doing `git checkout <tag>` assume that
`git switch <tag>` will do the same thing. Inform them of the --detach
option so they aren't left wondering why `git switch` doesn't work but
`git checkout` does.

Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/config/advice.txt
advice.c
advice.h
builtin/checkout.c
t/t2060-switch.sh