LinuxCommandLibrary

git-help

Display Git command documentation

TLDR

Display help about a specific Git subcommand

$ git help [subcommand]
copy

Display help about a specific Git subcommand in a web browser
$ git help [[-w|--web]] [subcommand]
copy

Display a list of all available Git subcommands
$ git help [[-a|--all]]
copy

List the available guides
$ git help [[-g|--guides]]
copy

List all possible configuration variables
$ git help [[-c|--config]]
copy

SYNOPSIS

git help [-a|--all] [-g|--guides] [-i|--info|-m|--man|-w|--web] [command|topic]

PARAMETERS

-a, --all
    List all available Git subcommands and topics. With command, shows only that one.

-g, --guides
    List all available Git guides (e.g., gitworkflows(7)). With guide, shows only that one.

-i, --info
    Display help using GNU info format instead of man pages.

-m, --man
    Display help using formatted man pages (default behavior).

-w, --web
    Display help by opening the relevant web page in a browser.

DESCRIPTION

The git help command is a built-in Git porcelain command that provides access to the extensive Git documentation system directly from the terminal. It serves as the primary interface for viewing help on Git subcommands, topics, and guides.

When invoked as git help <command>, such as git help commit, it displays the full manual page (man page) for that subcommand, including synopsis, description, options, parameters, exit codes, and examples. Without arguments, git help shows a general overview of Git usage, core concepts, and common workflows.

Users can control the output format with options: -m or --man (default) renders man-style pages; -i or --info uses GNU info format; -w or --web opens documentation in a web browser. Listing options like -a enumerate all available subcommands, while -g lists user guides (e.g., gitworkflows(7)).

This command respects the GIT_HELP environment variable for custom viewers and integrates seamlessly with Git's AsciiDoc-generated documentation. Ideal for developers needing quick, context-aware reference without external tools, it supports aliases, plumbing commands, and advanced topics, making Git self-documenting and user-friendly.

CAVEATS

Requires Git documentation (man pages/info) to be installed; web option needs a browser and internet for HTML5 docs. Some advanced topics may not have dedicated pages.

EXAMPLES

git help status
View man page for git status.

git help -a
List all Git commands.

git help -w branch
Open Git branch docs in browser.

ENVIRONMENT

GIT_HELP can override formats (e.g., man browser prioritizes web viewer).

HISTORY

Introduced in Git 1.5.3 (2007) as part of Git's early porcelain commands, building on initial help scripts from 2005 by Linus Torvalds and contributors. Evolved with Git core to support multi-format output, AsciiDoc rendering, and guide listings; now integral to Git's self-documenting design in versions up to 2.46+.

SEE ALSO

git(1), man(1), info(1)

Copied to clipboard