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

Linting Your Stack

gg lint runs your configured lint commands commit-by-commit across the stack.

Configure lint commands

In .git/gg/config.json:

{
  "defaults": {
    "lint": [
      "cargo fmt --check",
      "cargo clippy -- -D warnings"
    ]
  }
}

Run lint manually

gg lint

Run only up to a specific entry:

gg lint --until 2

When lint rewrites commits in sequential mode, --until freezes the originally selected entries before the first rewrite. If a rewrite drops one, an entry that shifts into the same stack position does not replace it.

A stable, unique GG-ID or title lets an originally selected entry continue across OID-changing rewrites. If an earlier rewrite makes a selected commit’s OID unresolvable and it has no unique GG-ID or title, lint fails closed with a validation could not be completed error instead of reporting success.

Inspect the rewritten current stack and rerun gg lint. Before retrying broader mutating validation, make commit identity unambiguous: prefer unique GG-IDs, otherwise use unique titles. Already-applied rewrites remain in place under the existing restoration behavior.

You can run lint after navigating to a detached position with gg mv. If lint rewrites that commit, git-gud leaves HEAD detached at the rewritten logical entry when it can identify the entry uniquely. If it cannot, git-gud safely restores the exact commit you started from rather than selecting a branch or a different stack entry.

Run lint during sync

gg sync --lint

If lint fails during gg sync --lint, sync is aborted and git-gud restores repository state to the pre-sync snapshot.

Skip lint for one sync (even if enabled by default):

gg sync --no-lint