Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where does the Git documentation mention that "git-foo" on $PATH can be called as "git foo"?

Tags:

git

manual

Git has this feature, where you can place any executable named git-foo on $PATH and then call it as git foo <args>, like a built-in subcommand (or is it more of a side-effect of how Git implemented subcommands in the early days?).

I learned this probably 15 years ago and now told someone about this who didn't know it already. I'd like to point them to some documentation explaining it in a bit more detail (e.g. the variables that are placed in the environment) by git.

Where is this behavior documented in the official documentation (or e.g. in a mail thread by the developers)?

like image 804
Feuermurmel Avatar asked Oct 14 '25 21:10

Feuermurmel


1 Answers

The only place I know of in the documentation is here (git help git, --list-cmds option, emphasis mine) :

--list-cmds=group[,group…]

List commands by group.
This is an internal/experimental option and may change or be removed in the future. Supported groups are: builtins, parseopt (builtin commands that use parse-options), main (all commands in libexec directory), others (all other commands in $PATH that have git- prefix), list-<category> (see categories in command-list.txt), nohelpers (exclude helper commands), alias and config (retrieve command list from config variable completion.commands)

like image 190
LeGEC Avatar answered Oct 17 '25 10:10

LeGEC



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!