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
share_prompts_in_repositoriesPattern[]Share prompts in authorship logs only for repositories matching these patterns. Supports glob patterns (e.g., https://github.com/myorg/*)Empty list (prompts not shared by default as of v1.0.25)
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"

[!NOTE] Prompt sharing is disabled by default as of v1.0.25. You do not need ignore_prompts flag anymore as this is now the default behavior.

Example Configuration

{
    "git_path": "/usr/bin/git",
    "share_prompts_in_repositories": [
        "https://github.com/acunniffe/git-ai.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 share_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

{
    "share_prompts_in_repositories": [
        "https://github.com/myorg/public-*",    // Share prompts only in public repos
        "https://github.com/myorg/docs"         // And in the docs repo
    ],
    "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).

Sharing Prompts in Authorship Logs

As of v1.0.25, prompt sharing is disabled by default. Prompts are only included in authorship logs for repositories that match patterns in share_prompts_in_repositories.

To share prompts in all repositories, use a wildcard pattern:

{
    "share_prompts_in_repositories": ["*"]
}

To share prompts only for specific trusted repositories:

{
    "share_prompts_in_repositories": [
        "https://github.com/myorg/trusted-repo.git",
        "https://github.com/myorg/public-*"
    ]
}

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