Huh, TIL.
To be fair, git switch
was also derived from the features of git checkout
in >2.23, but like git restore
, the manual page warns that behavior may change, and neither are in my muscle memory (lmao).
I’ll probably keep using checkout since it takes less kb in my head. Besides, we still have to use checkout for checking out a previous commit, even if I learn the more ergonomically appropriate No deprecation here so…switch
and restore
.
edit: maybe I got that java 8 mindset
edit 2: Correction – git switch --detach
checks out previous commits. Git checkout may only be there for old scripts’ sake, since all of its features have been split off into those two new functions… so there’s nothing really keeping me from switch
.
According to tab autocomplete…
$ git zsh: do you wish to see all 141 possibilities (141 lines)?
But what about the sub options?
$ git clone https://github.com/git/git $ cd git/builtin # looking through source, options seem to be declared by OPT # except for if statements, OPT_END, bug checks, etc. $ grep -R OPT_ | grep --invert-match --count -E \ "OPT_END|BUG_ON_OPT|if |PARSE_OPT|;$|struct|#define" 1517
Maybe 1500 or so?
edit: Indeed, maybe this number is too low.
git show
has a huge amount of possibilities on its own, though some may be duplicates and rewords of others.$ git show -- zsh: do you wish to see all 489 possibilities (163 lines)? $ man git-show | col -b | grep -E "^ -" --count 98
An attempt at naively parsing the manpages gives a larger number.
$ man $(find /usr/share/man -name "git*") \ | col -b | grep -E "^ -" -c 1849
Numbers all over the place. I dunno.