Lesson Completion
Back to course

Git Help and Documentation

Beginner
8 minutes4.7Git

The Hook (The "Byte-Sized" Intro)

The best Git tutor isn't on YouTube — it's already installed on your machine. Git ships with a complete built-in manual for every command, every flag, and every edge case. The devs who never get stuck aren't smarter — they just know how to ask Git for help.

📖 What is Git Help and Documentation?

Git includes a comprehensive, offline-available help system. You can look up any command, discover its options, read examples, and access topic guides — all without leaving your terminal or opening a browser.

Conceptual Clarity

Git's help system has three tiers:

TierCommandWhat You Get
Quick referencegit <command> -hShort summary of flags (stays in terminal)
Full manualgit help <command> or git <command> --helpComplete manual page (opens in pager/browser)
Topic guidesgit help -gList of conceptual guides (workflows, glossary, etc.)

Real-Life Analogy

Think of Git's help system like a restaurant menu:

  • -h = The chalkboard specials by the door (quick glance)
  • --help = The full menu with descriptions and ingredients (detailed reference)
  • help -g = The "About Our Kitchen" guide explaining the chef's philosophy (conceptual understanding)

Visual Architecture

flowchart TD Q["🤔 Stuck on a command?"] --> A["git commit -h<br/>(quick summary)"] Q --> B["git help commit<br/>(full manual)"] Q --> C["git help -g<br/>(topic guides)"] Q --> D["git help glossary<br/>(term definitions)"] style Q fill:#1a1a2e,stroke:#e94560,color:#e94560 style A fill:#1a1a2e,stroke:#ffd700,color:#ffd700 style B fill:#0f3460,stroke:#53d8fb,color:#53d8fb style C fill:#0f3460,stroke:#53d8fb,color:#53d8fb style D fill:#0f3460,stroke:#53d8fb,color:#53d8fb

Why It Matters

  • You can learn Git offline — no internet required.
  • Error messages often include hints like "See git help <command>" — follow them!
  • Knowing how to self-serve documentation makes you faster and more independent.
  • Interview tip: saying "I'd check git help" shows maturity and resourcefulness.

Code

bash
# ─── Quick summary (stays in terminal) ─── git commit -h # Output: Shows all flags like -m, -a, --amend, etc. git add -h # Output: Shows flags like -p, -A, --dry-run, etc. # ─── Full manual page (opens in pager) ─── git help commit # Opens the complete manual for git-commit git help rebase # Opens the complete manual for git-rebase # ─── Same thing, different syntax ─── git commit --help # Identical to git help commit # ─── List all available guides ─── git help -g # Output: # The Git concept guides are: # attributes Defining attributes per path # everyday Everyday Git commands # glossary Git glossary # workflows Git workflows overview # ... # ─── Read a specific guide ─── git help everyday # Shows commonly used Git commands grouped by role git help glossary # Shows definitions of Git terms # ─── List ALL Git commands ─── git help -a # Output: Lists every available Git command (plumbing + porcelain) # ─── Search for a command by keyword ─── git help -a | grep "branch" # Output: Shows all commands related to "branch"

Pro Tips for Self-Teaching

ScenarioWhat to Do
"What flags does git log accept?"git log -h
"I need to understand rebase deeply"git help rebase
"What Git commands exist?"git help -a
"What does this Git term mean?"git help glossary
"What commands should I use daily?"git help everyday
"Git gave me an error with a hint"Follow the hint — it almost always includes a git help reference

Key Takeaways

  • git <command> -h for a quick flag reference (stays in terminal).
  • git help <command> for the full manual page (detailed docs).
  • git help -g to browse conceptual guides and workflows.
  • Git's help is offline-first — no internet needed.
  • When Git throws an error, read the hint — it usually tells you what to do.

Interview Prep

  • Q: How do you quickly check the available options for a Git command? A: Use git <command> -h for a brief summary of flags and options displayed directly in the terminal. For a full manual, use git help <command> or git <command> --help.

  • Q: How would you find a Git command you don't know the name of? A: Use git help -a to list all available Git commands, then pipe through grep to filter by keyword. You can also use git help -g to browse topic-based guides.

  • Q: What is git help everyday and when would you use it? A: It's a built-in guide that lists commonly used Git commands grouped by role (individual developer, participant, integrator). It's useful for beginners to learn which commands matter most in their daily workflow.

Topics Covered

Git FundamentalsGit Introduction

Tags

#git#help#documentation#manpages

Last Updated

2026-02-12