Skip to content

Playbooks for g

Story-style workflows—solo, team, and on-call. Jump into the full Use cases page anytime.

commands::git

Git command helpers and enhanced output modes.

auto-generated This page is built from //! comments in the Rust source. Edit the source and run npm run docs:extract to update it.

Git command helpers and enhanced output modes.

This is the “engine room” of the CLI — every interaction with the underlying git binary lives here.

Folder layout

git/
  mod.rs        ← this file: public re-exports for the rest of the crate
  exec.rs       ← low-level git invocation (git_output, passthrough, …)
  dry_run.rs    ← global dry-run flag + git_mutate / dry_run_action
  repo.rs       ← repo introspection (current_branch, repo_root, …)
  log.rs        ← `g log` (enhanced)
  status.rs     ← `g status` (enhanced, --porcelain=v2 parsing)
  add.rs        ← `g add` + interactive stager
  diff.rs       ← `g diff` (builtin syntect renderer / passthrough / external pipe)
  branch.rs     ← `g branch` (enhanced + `branch squash`)
  show.rs       ← `g show` (metadata + diff)

Public surface

Every name the rest of the crate already uses as commands::git::XYZ is re-exported below. Adding a new helper means importing it here too — the folder split is otherwise invisible to callers.

Source: src/commands/git/mod.rs