Skip to main content
gat selection is Experimental: its interface or behavior may change. See Feature lifecycle.
Save and choose an optional default. These commands change configuration only; they do not fetch files, sync the working tree, or change tracking. Creation requires --path, --include, or --exclude. To save an unrestricted selection, make that choice explicit:
list, show, and default label this definition All tracked paths. It has no path or pattern restrictions; the label is not a count of current files. A filter that currently matches no tracked paths is still valid. Preview it with gat ls-files using --selection NAME; matches can change as the lock changes.
Adding a selection does not activate it. Use gat selection default NAME to choose a default, or --selection NAME for one operation. Without a default, supported commands select the whole repository.
Paths start at the repository root; patterns start at the selected path. Exclusions win. Named and inline selectors cannot be combined. Mount source filters are independent.
Different names coexist across scopes. A higher-priority definition replaces the complete entry of the same name. The default choice inherits separately, so a local default can use a shared project definition.Saved definitions omit the root path (.) and empty include/exclude lists. Clearing a filter removes its config key; it does not inherit that filter from a lower-priority definition. An unrestricted selection is saved as {}.Use add --local with a complete definition to override a project selection. Updates require at least one path, pattern, or clear option. Updates and removals must target the defining scope. Removing an override can reveal an inherited definition, but cannot leave the default dangling.gat selection default --local --unset restores inheritance. To persist an unrestricted choice, save a selection with --path . and no filters, then choose it as the default.
See Path selection for matching rules and examples, and Config inheritance for shared definitions and local overrides.

Usage

Subcommands

gat selection list

gat selection show

gat selection add

gat selection update

gat selection remove

gat selection default

gat selection add

Save a complete definition with at least one of --path, --include, or --exclude. Use --path . for all tracked paths. Adding a selection never chooses a default.

Usage

Examples

Patterns are relative to models.

gat selection default

Show or choose the optional default. --unset removes this scope’s pointer and restores inheritance. It does not select everything when a lower layer has a default.

Usage

Examples

Uses the shared definition without copying its filters.

gat selection list

List effective saved selections and mark the default.

Usage

Examples

Lists available definitions without changing configuration.

gat selection remove

Remove a definition in the selected scope. A lower-priority definition may be revealed. Removal cannot leave the effective default dangling.

Usage

Examples

Reveals a project or global runtime definition when present.

gat selection show

Show the saved path, patterns, and defining scope.

Usage

Examples

Reads the effective runtime definition.

gat selection update

Update a definition in its existing scope. At least one path, pattern, or clear option is required. Omitted fields are preserved; supplied lists replace the saved lists.

Usage

Examples

Keeps the saved path and includes.