Skip to main content

A Git extension for tracking AI-made changes with sub-nodes and sub-branches

Project description

Git AI

A Git extension that tracks and visualizes changes made by AI systems as separate nodes and branches in your commit tree, with full team collaboration support.

Because sometimes you need to track who's doing the actual thinking in your codebase.

Git AI Visualization

Warning ⚠️

This extension is highly experimental and under active development. The developers take no responsibility for any damages, data loss, or repository corruption that may occur when using this software on real-life repositories.

Use at your own risk and always test thoroughly on non-critical repositories first.

Features

  • 🤖 AI Change Tracking: Mark and track commits made by AI systems
  • 🌳 Visual Commit Tree: Enhanced git log with AI annotations and sub-branches
  • 📊 AI Statistics: View contribution statistics and AI system usage
  • 🔀 Smart Merging: Merge AI branches with proper conflict resolution
  • 📝 Metadata Storage: Store AI prompts, models, and context with commits
  • 🎨 Beautiful Visualization: Unicode and ASCII tree formats with colors
  • 🌐 Remote Collaboration: Full team synchronization of AI metadata and branches
  • ⚙️ Conflict Resolution: Handle AI metadata and branch conflicts intelligently

Installation

From PyPI (recommended)

pip install git-ai-tracker

From Source

git clone https://github.com/jgalego/git-ai.git
cd git-ai
pip install -e .

Development Installation

git clone https://github.com/jgalego/git-ai.git
cd git-ai
pip install -e ".[dev]"

Quick Start

# Get help
git ai help

# Initialize AI tracking
git ai init

# Start tracking an AI system
git ai track "GitHub Copilot"

# Make AI changes and commit them
git ai commit -m "Add user authentication" --ai-prompt "Create a login system" --ai-model "gpt-4"

# Visualize your AI contributions
git ai tree
git ai stats

Commands

Core Commands

  • git ai init - Initialize AI tracking for this repository
  • git ai track <ai-system> - Start tracking changes for an AI system
  • git ai commit -m <message> - Commit with AI metadata
  • git ai status - Show current AI tracking status
  • git ai help - Show detailed help information

Visualization Commands

  • git ai tree - Show commit tree with AI sub-branches
  • git ai log - Show commit history with AI annotations
  • git ai branches - Show AI branches structure
  • git ai stats - Show AI contribution statistics

Management Commands

  • git ai merge <ai-branch> - Merge AI branch with conflict resolution
  • git ai experiment <name> - Create experimental branch for testing AI ideas
  • git ai config - Configure AI tracking settings

Remote Commands

  • git ai setup <remote> - Setup remote synchronization
  • git ai push <remote> - Push AI data to remote
  • git ai remote-status <remote> - Show remote synchronization status

Team Collaboration

Setup for Team

# Repository owner
git ai init
git ai track "GitHub Copilot"
git ai commit -m "Add auth" --ai-prompt "Create login system"
git ai setup origin
git ai push origin

# Team member
git clone <repo>
git ai init                    # Initialize on cloned repo
git fetch origin refs/notes/ai:refs/notes/ai  # Get AI metadata
git ai track "Claude"          # Track their AI system
git ai commit -m "Add dashboard"
git ai push origin             # Share with team

Daily Workflow

git pull                       # Get latest changes
git fetch origin refs/notes/ai:refs/notes/ai  # Get AI metadata
# Make AI-assisted changes
git ai commit -m "..." --ai-prompt "..." --ai-model "..."
git ai push origin             # Share changes and AI metadata

Experimental Workflow

# Try experimental AI ideas
git ai experiment "feature-x"
git ai commit -m "Experimental feature" --ai-prompt "Try new approach"

# If experiment fails, switch back to main AI branch
git checkout ai/copilot/main

# If experiment succeeds, merge it
git checkout main
git ai merge ai/copilot/main_experiment_feature-x

How It Works

git-ai extends Git's functionality by:

  1. Metadata Storage: Uses Git notes to store AI-specific metadata (prompts, models, timestamps)
  2. Branch Management: Creates lightweight AI branches prefixed with ai/
  3. Commit Annotation: Marks commits with AI system information
  4. Visual Enhancement: Provides enhanced log and tree views showing AI contributions
  5. Remote Synchronization: Syncs AI notes, branches, and configuration across team

Architecture

your-repo/
├── .git/
│   ├── ai/                  # AI configuration
│   │   └── config.json      # AI systems and settings
│   └── notes/
│       └── ai               # AI metadata for commits
├── main                     # Your main branch
├── feature/auth             # Human feature branch
├── ai/copilot/main          # AI sub-branch of main
└── ai/copilot/feature/auth  # AI sub-branch of feature

Remote Synchronization

The extension synchronizes:

  • AI Notes: All metadata about AI contributions
  • AI Branches: Complete AI branch structure
  • AI Configuration: Team-wide AI system settings

Tree Visualization

git-ai provides enhanced commit visualization:

*   🤖 e1f2g3h4 Merge AI changes from ai/copilot/main (alice, 2024-01-15) [AI: merge]
|\
| * 🤖 c3d4e5f6 AI addition: error handling (alice, 2024-01-15) [AI: GitHub Copilot, Model: gpt-4, Prompt: Add error handling]
| * 🤖 b2c3d4e5 AI rewrite: improved validation (alice, 2024-01-15) [AI: GitHub Copilot, Model: gpt-4, Prompt: Make validation more robust]
| * 🤖 a1b2c3d4 AI: Add user authentication (alice, 2024-01-15) [AI: GitHub Copilot, Model: gpt-4, Prompt: Create a login system]
|/
* 👤 d4e5f6g7 Update documentation (bob, 2024-01-14)
* 👤 f5g6h7i8 Initial commit (alice, 2024-01-13)

Legend: 🤖 AI-generated • 👤 Human-made

Advanced Usage

Multiple AI Systems

git ai track "GitHub Copilot"
git ai track "Claude"
git ai track "Custom AI"

# View contribution breakdown
git ai stats

Code Review Integration

# Review only AI contributions
git ai log --ai-only

git ai merge ai/copilot/feature --strategy squash

CI/CD Integration

git ai track "CI Bot"
git ai commit -m "Auto-format code" --ai-model "prettier"

Troubleshooting

Remote Issues

# Sync AI metadata with remote
git ai setup origin
git ai push origin

# Manual sync if needed
git fetch origin refs/notes/ai:refs/notes/ai
git push origin refs/notes/ai

# Check remote status
git ai remote-status origin

Common Issues

  • "git-ai command not found": Check if package is installed (pip list | grep git-ai-tracker)
  • "No active AI session": Run git ai track "Your AI System"
  • "Not a git repository": Run commands from within a Git repository
  • Remote sync not working: Use standard git commands for notes and branches

Development

# Run tests
pytest

# Code formatting
black src/ tests/
isort src/ tests/

# Type checking
mypy src/

Requirements

  • Git 2.0+
  • Python 3.8+
  • Unix-like system (Linux, macOS) or WSL on Windows

License

MIT


Track your AI contributions and collaborate seamlessly with your team! 🤖✨

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

git_ai_tracker-0.1.0.tar.gz (28.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

git_ai_tracker-0.1.0-py3-none-any.whl (25.1 kB view details)

Uploaded Python 3

File details

Details for the file git_ai_tracker-0.1.0.tar.gz.

File metadata

  • Download URL: git_ai_tracker-0.1.0.tar.gz
  • Upload date:
  • Size: 28.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.2

File hashes

Hashes for git_ai_tracker-0.1.0.tar.gz
Algorithm Hash digest
SHA256 fa1045d00ad51b50754f1474ac707cf28d0e3ac519560376a88e8e5fd43c46a0
MD5 5275934ba79688250b73e9baca1defa7
BLAKE2b-256 b864794637d380d534d80949238c06cbda8e4c563d72e15172870ee878e6ba20

See more details on using hashes here.

File details

Details for the file git_ai_tracker-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: git_ai_tracker-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 25.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.2

File hashes

Hashes for git_ai_tracker-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e2742e1ca43f0d326295eca6cdbd34ea04ff13dcf2b3f905e19a6e25320b7610
MD5 ae61ad93e75c39834f91de59e8b6eab5
BLAKE2b-256 df1523f7d9fd7178655bb8d2b121f9281b638565659cdfe28e5f4c1c1ae1d411

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page