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

gg setup

Interactive setup for .git/gg/config.json.

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

Use this when:

  • Starting git-gud in a new repository
  • Working with self-hosted GitHub/GitLab
  • Updating defaults (base branch, username, lint config)

Quick Mode (default)

Quick mode prompts for only the essential settings:

  • Provider: GitHub or GitLab
  • Base branch: Default base branch (main/master/trunk)
  • Username: Username for branch naming

After completing quick setup, you’ll see:

Tip: Run 'gg setup --all' to configure advanced options (sync, land, lint, etc.)

Full Mode (--all)

Full mode organizes all settings into logical groups:

General

FieldTypeDefaultDescription
providerselectauto-detectGitHub or GitLab (auto-detects github.com and gitlab.com remotes; self-hosted instances require manual selection)
basestringauto-detectDefault base branch (main/master/trunk)
branch_usernamestringfrom CLI authUsername for branch naming
unstaged_actionselectaskAction for gg amend with unstaged changes

Sync

FieldTypeDefaultDescription
sync_auto_rebaseboolfalseAuto-rebase when base is behind origin
sync_behind_thresholdnumber1Commits behind origin before warning/rebase
sync_draftboolfalseCreate new PRs/MRs as drafts by default
sync_update_descriptionsbooltrueUpdate PR/MR descriptions on re-sync
sync_update_titleboolfalseUpdate PR/MR titles on re-sync
stack_nav_commentsboolfalsePost a managed navigation comment linking all PRs/MRs in the stack

Land

FieldTypeDefaultDescription
land_auto_cleanboolfalseAuto-clean stack after landing all
land_wait_timeout_minutesnumber30Timeout for gg land --wait

Lint

FieldTypeDefaultDescription
lintlistemptyLint commands to run per commit
sync_auto_lintboolfalseRun lint automatically before sync

Worktrees

FieldTypeDefaultDescription
worktree_base_pathstringemptyTemplate for stack worktrees ({repo}, {stack})

GitHub (only shown if provider is GitHub)

FieldTypeDefaultDescription
github.stacks_integrationselect (off, auto, force)autoGitHub Stacked PRs public-preview integration. auto is best effort with the optional gh stack extension; force reports unavailable capabilities as warnings; off disables it.

The GitHub Stacked PRs selector appears only when GitHub is selected as the effective provider. GitLab setup does not prompt for it and preserves any existing GitHub setting.

GitLab (only shown if provider is GitLab)

FieldTypeDefaultDescription
gitlab.auto_merge_on_landboolfalseUse “merge when pipeline succeeds”

Global Config

git-gud supports global configuration at ~/.config/gg/config.json. When running gg setup:

  • If no local config exists, global defaults are shown in prompts
  • Local config always takes precedence over global config

This allows you to set organization-wide defaults while allowing per-repo overrides.

All fields are written to config.json after setup, making it easy to review and edit configuration manually.

Note: auto_add_gg_ids is deprecated. Existing configs that include it are still read, but setup no longer prompts for it and runtime behavior always treats it as enabled.