Why does git help add "git -" before each command name?

If I need help with a command git status, I can enter git help statusand a help page will appear that says that the name is " git-status". But " git-status" is not a team, the team git statushas a space, not a hyphen.

If I enter git-statusor git git-status, I get an error message. So why does the help page call it git-status?

Git does the same with every command in the help pages. Why?

+4
source share
3 answers

Please note that at the beginning (2005-2008, Git 1.6.0), the Git subcommands were specified as git-xxxin yours $PATH.

Git 1.6.0:

Makefile $PATH, "git", "gitk" , .

Git "git-xyzzy" 2006 ( 1.5.4 release ).
git --exec-path " $PATH - , " git xyzzy ", "git-xyzzy" .

2006 :

, - .

bindir vs execdir, , - bindir.
> "git", , , .

, Git , git-* PATH, , 100+ git-* /usr/bin.
git " GIT_EXEC_PATH.

/usr/bin/git git-* PATH, "git" , git-*.
, , - - git foo.

s/git-foo/git foo/g , , , , .

+3

git-status git. PATH , git . Windows, , : C:\Program Files (x86)\Git\libexec\git-core. git unix- , , . - , , .

+2

- "".

Dim Time (2005ish), Git :

$ git-init
[initialized new repository ...]
$ git-add Makefile README
$ git-status
...
$ git-commit

, , bash, git- TAB 47,981 git, git-block-area git-hammer-branch ( , , :-)). , , , .

, Git ​​ front-end, git. , bash, bash " " , . , git TAB 30-40 100-.

.

+2
source

Source: https://habr.com/ru/post/1674902/


All Articles