Accessing Git’s Online Help

You can ask the git command for help using the git help command. By default, it just gives a list of the most common commands:

$ git help
The most commonly used git commands are:
   add           Add file contents to the index
   apply         Apply a patch on a git index file and a working tree
   archive       Create an archive of files from a named tree
...

You can also get a complete list of all the commands:

$ git help -a
git commands available in '/usr/bin'
------------------------------------------
  add                 gui                 reflog
  add--interactive    hash-object         relink
  am                  http-fetch          remote
...

Finally, you can get the Unix manpage for a particular command (every Git command, even the obscure ones, has a manpage). For example, to get help for the git add command:

$ git help add

Get Linux in a Nutshell, 6th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.