Skip to content

Welcome to Hug Documentation ​

Hug is a CLI tool to streamline development. It provides a humane, intuitive interface for Git and Mercurial, transforming complex commands into a predictable, unified 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).
  • Multi-VCS Support: Full support for both Git and Mercurial with automatic repository detection.

New to Hug? ​

👉 Start here: Getting Started Guide - Learn the essentials in 15 minutes

Learning Path

  1. Getting Started - Core concepts and your first workflow
  2. Workflows Guide - Advanced patterns and real-world scenarios
  3. Command Map - Complete command reference
  4. Cheat Sheet - Quick syntax lookup

Daily Users ​

Quick reference: Cheat Sheet - Common commands and hidden gems

Scenario-based: Workflows Guide - Investigation patterns, commit management, and recipes

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:

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 use hug llf file1 -1 and hug llf file2 -1.
  • Last N commits for a file: hug llf <file> -N (e.g., -2 for last 2). Use hug llfp <file> -1 for patches or hug llfs <file> -1 for changes.
  • Search history by file changes: Combine with lf or lc for message/code searches restricted to file touches.

Build Status ​

Deploy Docs to GitHub PagesRun TestsRegenerate VHS ImagesCopilot Setup Steps

Released under the Apache 2.0 License.