Welcome to Hug Documentation
Hug is a CLI tool to streamline development. It provides a humane, intuitive interface for Git, transforming complex commands into a predictable language that keeps you focused on coding.
Key features:
- Intuitive Commands: Shorter for common/safe ops, longer for powerful ones (e.g.,
hug b
to switch branches). - Safety Built-In: Previews, dry-runs, and confirmations for destructive actions.
- Discoverability: Grouped by prefix (e.g.,
h*
for HEAD,w*
for working directory). - Git-Only for Now: Full Git support; Mercurial, Sapling and others coming later.
Command Reference
Start with the Command Map for a quick overview of all families, or the Cheat Sheet for daily workflows.
Dive into detailed guides for command groups:
- HEAD Operations (h*): Undo and rewind commits
- Working Directory (w*): Clean up changes
- Status & Staging (s*, a*): View and stage files
- Branching (b*): Switch, list, and manage branches
- Commits (c*): Create and amend commits
- Logging (l*): Search and view history
- File Inspection (f*): Analyze file authorship and history
- WIP Workflow (w*): Park, resume, and unpark temp work
Tips for Common Queries
- Most recent commit touching a file: Use
hug llf <file> -1
to get the latest commit modifying a specific file (handles renames with--follow
). For multiple files, run separately and compare timestamps, or usehug llf file1 -1
andhug llf file2 -1
. - Last N commits for a file:
hug llf <file> -N
(e.g.,-2
for last 2). Usehug llfp <file> -1
for patches orhug llfs <file> -1
for changes. - Search history by file changes: Combine with
lf
orlc
for message/code searches restricted to file touches.