👋 Need help rolling out Git AI? Setup a call with the maintainers
Distributing Git AI Extension
Deploy Git AI extension across your organization using MDM or custom install scripts. Recommended enterprise deployment method for tracking AI code at scale.
Git AI is a git extension that maintains accurate AI authorship tracking with Git Notes.
- Simple Setup: Single binary deployment, no per-repository configuration
- Automatic Hook Triggering: Works without modifying repository hooks
- User Transparency: Developers use
gitcommands as normal - Easy Updates: Replace the binary to update all users
- No Repository Modification: Doesn't change
.git/hooksin repositories
When Git AI is installed:
- Calls to
gitare intercepted by thegit-aibinary and routed togit. Thestdioand the exit code are piped back to the caller making making the interception transparent to the caller. - Git AI will update AI Authorship depending on the command being executed. For example:
- When
git commitis executed successfully, Git AI will attach an AI Authorship Git Note to the commit. - When
git stashis run, Git AI will also stash working AI Authorship log so it can be restored when the stash is applied. - When
git rebaseis run, Git AI will update the AI Authorship of the resulting to accuratly reflect the AI Authorship of the code in the rebased history.
Installation Requirements
- OSX: 14.0+
- Ubuntu 18+ (and likely other Linux distributions from same era)
- Windows: 10+
- Git 2.23+ (must already be installed on the machine)
Installation Steps
Example Linux/Unix installation script: https://github.com/acunniffe/git-ai/blob/main/install.sh Example Windows installation script: https://github.com/acunniffe/git-ai/blob/main/install.ps1
Option A: User-Scoped Directory
Unix/Linux/macOS
- Install the
git-aibinary to$HOME/.git-ai/bin/git-ai - Create symlinks in that directory:
git→git-aigit-og→/path/to/original/git
- Ensure executability:
chmod +x $HOME/.git-ai/bin/git-ai - macOS only: remove the quarantine attribute (
xattr -d com.apple.quarantine $HOME/.git-ai/bin/git-ai)
Windows
- Install the binary to
%USERPROFILE%\.git-ai\bin\git-ai.exe - Create a copy
%USERPROFILE%\.git-ai\bin\git.exe(copy ofgit-ai.exe) - Create a batch file
%USERPROFILE%\.git-ai\bin\git-og.cmdthat calls the original git executable - Unblock the downloaded files (PowerShell:
Unblock-File)
Option B: Overwrite an Existing Git Symlink
Use this when your fleet already exposes git from a shared directory that is locked into PATH (for example /usr/local/bin/git). Pick a writable directory—macOS SIP prevents modifying /usr/bin.
Unix/Linux/macOS
- Locate the distributed git entry and its directory:
git_path="$(command -v git)" git_dir="$(dirname "$git_path")" - Preserve the original git binary:
- If
git_pathis a symlink:sudo ln -sf "$(readlink "$git_path")" "$git_dir/git-og" - If it's a regular file:
sudo mv "$git_path" "$git_dir/git-og"
- If
- Install the extension alongside it:
sudo install -m 0755 /path/to/git-ai "$git_dir/git-ai" - Point
gitat the extension:sudo ln -sf "$git_dir/git-ai" "$git_path" - Confirm that
"$git_dir/git-og"remains executable—Git AI will delegate to it.
Windows
- Resolve the shim exposed on PATH (Git for Windows usually surfaces
C:\Program Files\Git\cmd\git.exe):$gitPath = (Get-Command git).Source $gitDir = Split-Path $gitPath - Preserve the original git executable:
if ((Get-Item $gitPath).Attributes -band [IO.FileAttributes]::ReparsePoint) { $target = (Get-Item $gitPath).Target New-Item -ItemType SymbolicLink -Path (Join-Path $gitDir 'git-og.exe') -Target $target | Out-Null Remove-Item $gitPath } else { Rename-Item -Path $gitPath -NewName 'git-og.exe' } - Copy the extension into the same directory:
Copy-Item -Path 'C:\path\to\git-ai.exe' -Destination (Join-Path $gitDir 'git-ai.exe') - Replace
git.exewith a link to the extension (requires Developer Mode or elevated privileges to create file symlinks). If symlinks are disabled, copygit-ai.exetogit.exeinstead.New-Item -ItemType SymbolicLink -Path (Join-Path $gitDir 'git.exe') -Target (Join-Path $gitDir 'git-ai.exe')# Fallback when symlinks are unavailable Copy-Item -Path (Join-Path $gitDir 'git-ai.exe') -Destination (Join-Path $gitDir 'git.exe') - Verify that
git-og.exeis still runnable:& (Join-Path $gitDir 'git-og.exe') --version
This method keeps the rest of PATH untouched and ensures existing automation continues to call git while Git AI intercepts the command.
PATH Configuration
Unix/Linux/macOS:
- Add
$HOME/.git-ai/binto the beginning of the user's PATH (Option A) - For Option B, confirm the directory containing
gitalready precedes other Git installations so the new symlink wins - Update the appropriate shell config file (
.zshrc,.bashrc, etc.) when PATH changes are required
Windows:
- Add
%USERPROFILE%\.git-ai\binto the System PATH - The directory should be positioned before any existing Git installation directories to ensure the git-ai extension takes precedence
Configuration File
Create $HOME/.git-ai/config.json (or %USERPROFILE%\.git-ai\config.json on Windows) with your organization's settings. Always set git_path to the location of the preserved original binary (git-og). See Enterprise Configuration for details.
Example:
{
"git_path": "/path/to/git-og",
"ignore_prompts": false,
"allow_repositories": [
"https://github.com/yourorg/*"
]
}For Option A, the git_path value should typically point to $HOME/.git-ai/bin/git-og. For Option B, use the absolute path where you stored the preserved binary (for example /usr/local/bin/git-og on macOS/Linux or C:\\Program Files\\Git\\cmd\\git-og.exe on Windows).
IDE/Agent Hook Installation
After installing the binary and configuring PATH, run:
git-ai install-hooksThis sets up integration with supported IDEs and AI coding agents (Cursor, VS Code with GitHub Copilot, etc.).
MDM Deployment
For enterprise deployments, you can use your MDM (Mobile Device Management) solution to:
- Distribute the Binary: Package and deploy the
git-aibinary to the appropriate directory - Configure PATH: Use login scripts or profiles to add the git-ai directory to PATH
- Deploy Configuration: Push the
config.jsonfile with organization-specific settings - Run Post-Install: Execute
git-ai install-hooksvia script after installation
Custom Install Script
You can create a custom installation script for your organization. Our official install scripts serve as references:
- Unix/Linux/macOS:
install.sh - Windows:
install.ps1
These scripts handle edge cases like:
- Detecting the original git path
- Preventing recursive installations
- Gracefully handling errors
- Setting proper permissions
Verification
After installation, verify the setup:
# Should show git-ai extension
which git
# Should show git-ai version
git --version
# Should show original git
git-og --version