Remix.run Logo
freehorse an hour ago

I puzzled over the "The Long and Short of It" as for me (git version 2.54.0)

  git -h branch
gives the same output as

  git branch --help
so I could not understand why master git jumped and died. But it seems that in older versions it threw an argument error according to the old discussion [0].

I see that `git -h branch`, `git branch --help` and `git --help branch` give the long output but `git branch -h` gives the short. I suspect that `git [-h | --help] branch` is converted to `git help branch` which runs `help` with argument `branch`. But `git branch -h` runs `branch` with argument `-h`. Also as `git -h alias` prints the alias definition while `git alias -h` gives the short help for the aliased command.

[0] https://news.ycombinator.com/item?id=5512103