Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Configuration

git-gud uses a layered configuration system:

  1. Global config: ~/.config/gg/config.json — shared defaults across all repos
  2. Local config: .git/gg/config.json — per-repository settings

Local config always takes precedence over global config.

Setup

Initialize or update local config with:

gg setup        # Quick mode: essential settings only
gg setup --all  # Full mode: all settings organized by category

For global config, manually create ~/.config/gg/config.json with your preferred defaults.

Example config

{
  "defaults": {
    "provider": "gitlab",
    "base": "main",
    "branch_username": "your-username",
    "lint": [
      "cargo fmt --check",
      "cargo clippy -- -D warnings"
    ],
    "auto_add_gg_ids": true,
    "unstaged_action": "ask",
    "land_wait_timeout_minutes": 30,
    "land_auto_clean": false,
    "sync_auto_lint": false,
    "sync_auto_rebase": false,
    "sync_behind_threshold": 1,
    "sync_draft": false,
    "sync_update_descriptions": true,
    "worktree_base_path": "/tmp/gg-worktrees",
    "gitlab": {
      "auto_merge_on_land": false
    }
  }
}

defaults options

OptionTypeWhat it controlsDefault
providerstringProvider (github/gitlab) for self-hosted or explicit overrideAuto-detected
basestringDefault base branch for new stacksAuto-detected
branch_usernamestringUsername prefix in stack/entry branch namesAuto-detected
lintstring[]Commands used by gg lint / gg sync --lint[]
auto_add_gg_idsbooleanDeprecated compatibility field. gg always enforces GG metadata normalization, regardless of this value.true
unstaged_actionstringDefault behavior for gg sc/gg amend when unstaged changes exist: ask, add, stash, continue, or abortask
land_wait_timeout_minutesnumberTimeout for gg land --wait polling30
land_auto_cleanbooleanAuto-run cleanup after full landingfalse
sync_auto_lintbooleanAutomatically run gg lint before gg syncfalse
sync_auto_rebasebooleanAutomatically run gg rebase before gg sync when behind threshold is reachedfalse
sync_behind_thresholdnumberWarn/rebase in gg sync when base is at least this many commits behind origin/<base> (0 disables check)1
sync_draftbooleanCreate new PRs/MRs as drafts by defaultfalse
sync_update_descriptionsbooleanUpdate PR/MR descriptions on re-synctrue
worktree_base_pathstringBase directory for managed worktreesParent of repo
gitlab.auto_merge_on_landbooleanDefault GitLab auto-merge behavior for gg landfalse

Global Config

Store shared defaults in ~/.config/gg/config.json. This is useful for:

  • Organization-wide settings (e.g., always use drafts)
  • Personal preferences that apply to all your repos
  • Reducing repetitive setup across multiple repositories

Example global config:

{
  "defaults": {
    "sync_draft": true,
    "land_auto_clean": true,
    "sync_behind_threshold": 5
  }
}

When gg setup runs in a new repo, these global defaults will be shown in prompts. You can accept them or override per-repo.

Stack state

git-gud also stores stack-specific state in the local config file (for example PR/MR mappings by GG-ID). This is how it remembers which commit corresponds to which PR/MR over time.

PR/MR templates

You can customize descriptions by creating .git/gg/pr_template.md.

Supported placeholders:

  • {{title}}
  • {{description}}
  • {{stack_name}}
  • {{commit_sha}}

Example:

## Summary

{{description}}

---

**Stack:** `{{stack_name}}`
**Commit:** `{{commit_sha}}`