Expand description
The complete Git 2.56.0 option tables of git checkout and git switch.
What:
The complete option tables of git checkout and git switch in Git 2.56.0.
Why:
Both commands create branches explicitly (-b,
-c,
--orphan,
--track) and
implicitly (a name that matches one remote branch).
The tables are assembled as
Git assembles them:
the command’s own rows,
then the shared groups
(builtin/checkout.c:1786-1847,
2118-2129,
2170-2179).
In TS you’d write (pseudocode):
// export const CHECKOUT_TABLE: readonly OptionSpec[] = [ ... ];Constants§
- CHECKOUT_
TABLE - What:
git checkout:checkout_options, then the common, switch-branch and checkout-path groups.Some(b'b')withNoneis an option that has only a letter. Why:-band-Btake the branch name as a value;--trackand--recurse-submodulestake an attached value only. - DETACH
-d,--detach.- GUESS
--guess,--no-guess.- NEW_
BRANCH checkout -b <branch>,switch -c/--create <branch>.- NEW_
BRANCH_ FORCE checkout -B <branch>,switch -C/--force-create <branch>.- ORPHAN
--orphan <new-branch>.- OVERLAY
checkout --overlay,--no-overlay.- PATCH
checkout -p/--patch.- STAGE
checkout -2/--oursand-3/--theirs.- SWITCH_
TABLE - What:
git switch:switch_options, then the common and switch-branch groups. Why:switchhas no path options;-cand-Chave long names and can be negated. - TRACK
-t,--track[=(direct|inherit)];--no-trackwrites the same variable.