Git AI

Git AI Configuration

Configure Git AI's behavior across your organization using the config.json file to control prompts, repository access, and git binary paths.

Git AI's behavior can be configured on developer machines by writing a JSON file in the user's home directory.

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.

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
ignore_promptsbooleanWhether prompts should be excluded from authorship logsfalse
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"

Example Configuration

{
    "git_path": "/usr/bin/git",
    "ignore_prompts": false,
    "allow_repositories": [
        "https://github.com/acunniffe/git-ai.git"
    ],
    "exclude_repositories": [
        "https://github.com/internal/private-repo.git"
    ],
    "disable_version_checks": false,
    "disable_auto_updates": false,
    "update_channel": "latest"
}

Update Controls

Most enterprises roll out new binaries gradually. Combine these three options to match your rollout plan:

  • update_channel selects which release feed each machine follows. Use next for early adopters and keep the rest of the org on latest.
  • disable_version_checks completely skips the asynchronous checks that normally run on fetch/pull/push. Only use this if you manage upgrades manually.
  • disable_auto_updates keeps those checks but stops the background installer, so the CLI only surfaces a "run git-ai upgrade" message.

Because the config file lives in each user's home directory, you can templatize these fields through MDM, your endpoint management tool, or any bootstrap script.

Configuration Use Cases

Limiting to Specific Repositories

Use allow_repositories to enable Git AI only for approved repositories. You can use exact URLs or glob patterns:

{
    "allow_repositories": [
        "https://github.com/yourorg/product-repo.git",
        "https://github.com/yourorg/mobile-app.git",
        "https://github.com/yourorg/*"
    ]
}

The glob pattern https://github.com/yourorg/* will match all repositories under your organization.

Excluding Sensitive Repositories

Use exclude_repositories to prevent Git AI from tracking specific repositories. Glob patterns make it easy to exclude entire categories:

{
    "exclude_repositories": [
        "https://github.com/yourorg/**",
        "**/org/**",
    ]
}

Glob patterns like https://github.com/*/private-* will match any repository starting with "private-" from any organization, and *secret* will match any remote URL containing the word "secret".

Glob Pattern Support

Both allow_repositories and exclude_repositories support glob patterns for flexible repository matching:

  • * matches any sequence of characters within a path segment
  • ? matches any single character
  • [abc] matches any character in the brackets
  • [!abc] matches any character not in the brackets

Common Glob Pattern Examples

{
    "allow_repositories": [
        "https://github.com/myorg/*",           // All repos in myorg
        "https://github.com/*/public-*",        // Any repo starting with public-
        "*@github.com:company/*",               // SSH remotes for company org
        "https://*.internal.com/*"              // Any internal domain repos
    ],
    "exclude_repositories": [
        "https://github.com/*/test-*",          // Any test repositories
        "*.internal.private.com/*"              // Specific internal domain
    ]
}

Note: Exact URLs still work as before and are treated as literal patterns (no wildcards needed).

Privacy-First Setup

Set ignore_prompts to true to exclude all prompts from authorship logs:

{
    "ignore_prompts": true
}

Telemetry for Custom Forks

If you build git-ai from source you can set your Sentry-compatible DSN at build time instead of using the config.json file.

SENTRY_ENTERPRISE="https://enterprise-key@o0.ingest.sentry.io/456" \
cargo build --release

Deployment

See the deployment guides for instructions on rolling out Git AI and configuration files to developer machines: