Git AI is now part of OpenAI
Git AI
Get Started

Git AI Configuration

Configure Git AI's behavior using the config.json file.

Git AI's behavior can be configured on developer machines by writing a JSON file in the user's home directory, or by using the git ai config CLI commands.

On Linux and macOS, this file is located at $HOME/.git-ai/config.json. On Windows, this file is located at %USERPROFILE%\.git-ai\config.json.

Using git ai config

You can view and manage configuration directly from the command line instead of editing the JSON file by hand.

# Show all effective configuration as formatted JSON
git ai config

# Show a specific config value
git ai config <key>

# Set a config value
git ai config set <key> <value>

# Add to an array value (extends existing entries instead of replacing)
git ai config set <key> <value> --add
git ai config --add <key> <value>

# Remove a config value (reverts to its default)
git ai config unset <key>

Repository pattern resolution

For repository array fields (allow_repositories, exclude_repositories), values can be provided as:

  • Glob patterns"*", "https://github.com/org/*"
  • URLs / git protocols"git@github.com:org/repo.git"
  • Local file paths"." or "/path/to/repo" (automatically resolves to the repository's remote URLs)
# Exclude the current repo using path resolution
git ai config set exclude_repositories .

# Add another repo by path
git ai config --add exclude_repositories ~/projects/my-repo

# Set with a glob pattern
git ai config set allow_repositories "https://github.com/myorg/*"

# Add a feature flag using dot notation
git ai config --add feature_flags.my_flag true

Configuration Options

All options in config.json are optional and will fall back to default values if not provided.

OptionTypeDescriptionDefault
git_pathPathThe path to the (unaltered) git binary you distribute on developer machinesWhichever git is on the shell path
allow_repositoriesPattern[]Allow git-ai in only these remotes. Supports glob patterns (e.g., https://github.com/myorg/*)If not specified or set to an empty list, all repositories are allowed
exclude_repositoriesPattern[]Exclude git-ai from these remotes. Supports glob patterns (e.g., https://github.com/myorg/*)If a repository is present in both allow and exclude lists, exclusion takes precedence
telemetry_oss"off"Disable OSS performance metrics and error logging sent to Git AI maintainersDefaults to enabled
telemetry_enterprise_dsnstringA Sentry DSN to use to send yourself performance metrics and error loggingDefaults to none
disable_version_checksbooleanSkip automated version checks that would otherwise run on fetch/pull/pushfalse
disable_auto_updatesbooleanKeep checking for updates but never install them automaticallyfalse
update_channel"latest" | "next"Release channel to follow (latest = stable, next = prerelease)"latest"
quietbooleanSuppress chart output after commitsfalse
feature_flagsobjectFeature flag overrides. Set nested keys with dot notation (e.g., feature_flags.my_flag){}

Example Configuration

{
    "git_path": "/usr/bin/git",
    "allow_repositories": [
        "https://github.com/yourorg/*"
    ],
    "disable_auto_updates": false,
    "update_channel": "latest"
}

Ignoring Files

Git AI automatically excludes common non-source artifacts: lockfiles, generated/minified files, vendor dependencies, and snapshot artifacts. Files marked linguist-generated in .gitattributes are also excluded.

Add custom ignore patterns with --ignore:

# Exact filename
git ai stats --ignore Cargo.lock

# Glob pattern (quote to prevent shell expansion)
git ai stats --ignore "*.lock"

# Multiple patterns
git ai stats --ignore Cargo.lock "*.generated.*" package.lock

For persistent ignore rules, create a .git-ai-ignore file in the repository root:

# Comments allowed
docs/generated/**
*.snap
vendor/**

Effective ignore patterns are the union of built-in defaults, .gitattributes (linguist-generated), .git-ai-ignore, and CLI --ignore flags. --ignore is additive — it does not replace defaults.