By admin , 28 April 2026

Introduction

Git ships with extensive built-in documentation. Knowing how to summon it quickly will save you hours of guesswork. This page tours the help system from one-liners to full manuals.

Three ways to ask

Each command supports three forms of help:

git help <command>     # full man page in your pager
git <command> --help    # same thing
git <command> -h        # short usage summary

Example:

git help commit
git commit --help
git commit -h

Listing commands

git help -a            # all commands
git help -g            # guides (gittutorial, gitcore-tutorial, etc.)
git help everyday      # the everyday Git cheatsheet

git help everyday in particular is one of the best beginner-to-intermediate references shipped with Git.

Concept guides

Git includes prose guides as separate man pages:

git help gittutorial
git help gitcore-tutorial
git help gitglossary
git help gitworkflows
git help gitrevisions

gitrevisions is the canonical reference for ref syntax (HEAD~3, main@{yesterday}, etc.).

Configuring the help format

By default git help opens a man page. You can switch to HTML or info:

git config --global help.format html
git config --global help.format info
git config --global help.format man   # default

HTML opens the local copy in your browser, useful on systems without man.

Online resources

  • git-scm.com/docs: official manual mirrored online.
  • Pro Git book by Chacon and Straub: free, comprehensive, regularly updated.
  • Git mailing list archive: lore.kernel.org/git for design discussions.

Searching documentation

If you do not remember a command name, man -k git (or apropos git) lists every Git man page with a one-line description. To search inside the docs, pipe to grep:

man -k git
git help -a | grep -i merge
git help log | grep -A 2 'pickaxe'

For long-form learning, the Pro Git book is free and authoritative; the Git Reference Manual at git-scm.com/docs mirrors the man pages with cross-links. The gitfaq man page is an underused gem that answers many real-world questions in plain prose.

Common mistakes

Searching the web for outdated Stack Overflow answers using deprecated commands like git checkout for branch switching when git switch exists. Always cross-check against git help for your installed version. Another mistake is assuming -h and --help behave the same; they do not. -h prints a one-screen summary, while --help opens the full man page (or browser, depending on help.format). Lastly, do not skip git help glossary; many "weird" Git terms (porcelain, plumbing, refspec, dangling object) are defined precisely there in a single short page.