Why and When to Use Git Help
Git comes with a lot of commands and options.
If you ever forget how a command works or want to explore its available options, Git’s built-in help system is the quickest way to get answers—right from your terminal.
This saves time and keeps your workflow uninterrupted.
Key Commands to Get Help in Git
- git help <command> – Open the manual page for a specific command
- git <command> --help – Show detailed help for the command (same as above)
- git <command> -h – Display a brief summary of options
- git help --all – List all available Git commands
- git help -g – View guides and conceptual topics about Git
View Help for a Specific Git Command (git help <command>)
Use this command to open the detailed manual (man page) for any Git command. The manual includes a complete list of options, usage details, and examples.
Example:
View Help for the commit Command
git help commit
Output:
sql
GIT-COMMIT(1)
NAME
git-commit - Record changes to the repository
SYNOPSIS
git commit [options] [--] <pathspec>...
DESCRIPTION
Create a new commit containing the current contents of the index
and a log message provided by the user describing the changes.
...
This will open the full manual page for git commit in your terminal, helping you learn about all its options and usage.
View Help with --help (git <command> --help)
You can also use --help after any Git command to see its manual page.
This works the same as git help <command>, and many users find it quicker to type.
Example:
View Help for status
git status --help
This command shows the manual page for git status, including its usage, options, and a description:
scss
GIT-STATUS(1)
NAME
git-status - Show the working tree status
SYNOPSIS
git status [options] [--] [pathspec...]
DESCRIPTION
Displays paths that have differences between the index file and the current HEAD commit.
Use this whenever you need to quickly check what a Git command does or explore its options.
Get a Quick Option Summary with -h (git <command> -h)
Use the -h option to see a brief summary of a Git command’s available options.
This shows help directly in your terminal without opening the full manual page.
Example:
Quick Help for git add
git add -h
Sample output:
sql
usage: git add [options] [--] <pathspec>...
-n, --dry-run show what would be added, without actually adding
-v, --verbose show detailed output
-i, --interactive add changes interactively
-p, --patch select parts of files to add
-e, --edit manually edit and apply changes
-u, --update update tracked files only
-A, --all add all changes (tracked and untracked)
This is a quick way to check what options are available for any Git command.
List All Git Commands
You can see every Git command available on your system with:
git help --all
This shows a very long list of commands, organized by category.
Example output:
$ git help --all
See 'git help <command>' to read about a specific subcommand
Main (Everyday) Commands
These are the commands most users work with daily:
- add – Add file contents to the index
- commit – Record changes to the repository
- status – Show the working tree status
- log – Show commit logs
- diff – Show changes between commits or working directory
- branch – List, create, or delete branches
- checkout – Switch branches or restore files
- merge – Join development histories together
- clone – Copy a repository into a new directory
- pull – Fetch and merge from a remote repository
- push – Update remote refs with local commits
- init – Create an empty Git repository
- rm – Remove files
- mv – Move or rename files
- rebase – Reapply commits on top of another base tip
- stash – Stash away changes in a dirty working directory
- tag – Create, list, or delete tags
- reset – Reset current HEAD to a specified state
- show – Show objects (e.g., commits, tags)
- fetch – Download objects and refs from another repository
Ancillary Commands (Helpers & Tools)
Config & Repository Maintenance
- config – Get and set Git configuration options
- gc – Clean up unnecessary files and optimize repository
- reflog – Manage reference logs
- remote – Manage tracked repositories
- repack – Pack unpacked objects
Inspect & Debug
- blame – Show who last modified each line
- annotate – Like blame, shows commit info per line
- help – Display help about Git commands
- fsck – Verify repository data
- count-objects – Count unpacked objects and disk space used
Diff & Merge Tools
- difftool – Use external diff tools
- mergetool – Use external merge tools
- range-diff – Compare two commit ranges
Interacting with Other Systems
- svn – Work with Subversion repositories
- p4 – Work with Perforce repositories
- cvsimport – Import from CVS
- send-email – Send patches as emails
- request-pull – Generate pull request summary
Low-Level Commands
These are plumbing commands Git uses internally (rarely used directly):
- cat-file – Show object info and contents
- hash-object – Compute object IDs
- update-index – Manage the index manually
- write-tree – Create tree object from index
- rev-parse – Parse revision names and parameters
- read-tree – Read tree into the index
- ls-files – Show index and working directory info
- symbolic-ref – Manage symbolic references
Networking & Sync
- fetch-pack, send-pack – Transfer objects between repositories
- daemon – Simple Git server
- http-backend – Git over HTTP server helper
Internal Helpers
- check-ignore – Debug .gitignore patterns
- patch-id – Compute patch IDs
- mailinfo / mailsplit – Process emails into patches
- column – Format output into columns
- credential – Manage user credentials
External Commands
You may see commands like:
- lfs – Git Large File Storage
- flow – Git Flow helpers
- askyesno – Interactive prompts
Tip:
Use
git help <command>
to see detailed help and examples for any specific command.
List Guides and Concepts (git help -g)
Use this command to see a list of Git guides and conceptual topics that help you dive deeper into how Git works.
Example:
git help -g
Output:
sql
The common Git guides are:
attributes Defining attributes per path
everyday Everyday Git With 20 Commands Or So
glossary A Git glossary of terms
revisions Specifying revisions and ranges for Git
This is especially useful for exploring Git’s advanced topics, workflows, and best practices beyond the basic commands.
Troubleshooting
- How do I exit the help viewer?
- Help page isn’t opening?
Use git <command> -h to see a quick summary of options instead.
- How can I search within the help page?
Press /, type the word you’re looking for, and press Enter to search.