Git AI

👋 Need help rolling out Git AI? Setup a call with the maintainers

Git AI Configuration

Configure Git AI's behavior across your organization using the config.json file to control prompt sharing, 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
prompt_storage"default" | "notes" | "local"Controls where prompt data is stored. default = local/enterprise, notes = include in git notes, local = local SQLite only"default"
exclude_prompts_in_repositoriesPattern[]Exclude prompts from authorship logs for repositories matching these patterns. Supports glob patterns (e.g., https://github.com/myorg/*). Use "*" to exclude all.Empty list (no exclusions)
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",
    "exclude_prompts_in_repositories": [
        "https://github.com/internal/private-repo.git",
        "https://github.com/private-org/**"
    ],
    "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

The exclude_prompts_in_repositories, allow_repositories, and exclude_repositories fields all 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

{
    "exclude_prompts_in_repositories": [
        "https://github.com/myorg/private-*",   // Exclude prompts from private repos
        "https://github.com/internal/*"          // Exclude prompts from internal org
    ],
    "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).

Prompt Storage Modes

By default, Git AI stores prompt data locally only in a SQLite database. Prompts are not included in git notes.

To include prompts in authorship logs (git notes), set prompt_storage to notes:

{
    "prompt_storage": "notes"
}

When clients are configured for Git AI enterprise, notes are securely uploaded to your Git AI enterprise instance.

Excluding Prompts from Specific Repositories

You can exclude specific repositories from having prompt data included in authorship logs by using exclude_prompts_in_repositories:

{
    "prompt_storage": "notes",
    "exclude_prompts_in_repositories": ["*"]
}

To exclude prompts only from specific private repositories:

{
    "prompt_storage": "notes",
    "exclude_prompts_in_repositories": [
        "https://github.com/myorg/private-repo.git",
        "https://github.com/myorg/internal-*"
    ]
}

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