0

I use Windows 7.What is the correct way to use help in Git Bash?

help command

or

command --help

For example:

I have to use CTRLC to break result of below command

$ while --help
>

But this works:

$ help while
while: while COMMANDS; do COMMANDS; done
     Expand and execute COMMANDS as long as the final command in the
    `while' COMMANDS has an exit status of zero.

Or

$ help touch
sh.exe": help: no help topics match `touch'.  Try `help help' or `man -k touch'
or `info touch'.

But

$ touch --help
Usage: touch [OPTION]... FILE...
  or:  touch [-acm] MMDDhhmm[YY] FILE... (obsolescent)
...

I looked at An A-Z Index of the Bash command line for Linux.But I do not find any thing in about using help command.

hasanghaforian
  • 13,858
  • 11
  • 76
  • 167

1 Answers1

1

As mentioned in How to Get Help With a Command from the Linux Terminal, help is only for a short list of the commands built into the Bash shell itself. touch is not one of them.

For git commands, you would call git help <command> (like git help checkout).

Make sure to use git-bash.exe packaged with the latest release from git-for-windows: its bash is significantly more recent than the old msysgit one.
See "Why is it that if you download Git 2.0 from the net, you always get a 1.9.4 installer package?".

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250