Skip to main content

AI-powered Git assistant

Project description

GitGud - AI-Powered Git Assistant

Make Git operations effortless with intelligent analysis and recommendations

GitGud is a command-line tool that analyzes your Git repository and provides smart recommendations for push, pull, and commit operations. No more failed pushes, confusing errors, or Git anxiety!

Features

Repository Health Dashboard

See your repository state at a glance with a beautiful terminal UI:

$ gitgud status

╭─────────────────────────────────────────╮
│  Repository Health                      │
│  Repository  my-project                 │
│  Branch      main                       │
│  Remote      origin/main                │
│                                         │
│  Status      [OK] CLEAN                 │
│                                         │
│  Commits                                │
│    Ahead      0 commits                 │
│    Behind     0 commits                 │
│                                         │
│  Changes                                │
│    Modified     0 files                 │
│    Untracked    0 files                 │
╰─────────────────────────────────────────╯

Smart Commit Messages

Automatically generate descriptive commit messages from your changes:

$ gitgud commit

GitGud Smart Commit

Changes to be committed:
  Modified:  3 files
  Untracked: 1 files

Generating commit message...

Generated commit message:
┌────────────────────────────────────────┐
│ feat: add user authentication          │
│                                        │
│ - add auth service                     │
│ - add login component                  │
│ - update routes                        │
└────────────────────────────────────────┘

? What would you like to do?
  > Use this message
    Edit message
    Enter manually
    Cancel

Features:

  • Analyzes file changes and diff patterns
  • Follows Conventional Commits format (feat, fix, docs, etc.)
  • Interactive approval and editing
  • Optional AI enhancement with --ai flag

Smart Push

Intelligent push strategy based on repository state:

$ gitgud push

Analyzing repository...
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Repository State
  Branch: feature/login
  Ahead:  3 commits
  Behind: 1 commit

Recommendation
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Strategy: pull-then-push
Reasoning: Pull with rebase to maintain linear history

Commands:
  1. git pull --rebase origin feature/login
  2. git push origin feature/login

Execute? [Y/n]

Handles:

  • Ahead/behind scenarios
  • Uncommitted changes (auto-stash)
  • Divergent branches
  • Untracked remote branches

Divergent Branch Resolution

Interactive guidance when your branch has diverged:

$ gitgud resolve

Branch Divergence Detected

Your situation:
├─ You have 2 local commits
└─ Remote has 3 commits you don't have

Your Options:
1. Pull --rebase (RECOMMENDED)
   + Clean history, linear timeline
   - May cause conflicts

2. Pull (merge)
   + Safe & simple
   - Creates merge commit

3. Force push (DANGEROUS)
   ! DELETES teammate's work

Recommendation: git pull --rebase
? How would you like to resolve this? (Use arrows)
  > Pull with rebase (keeps history clean)
    Pull with merge (safer)
    Cancel

Installation

From PyPI (Recommended)

pip install gitgud-cli

From Source

git clone https://github.com/Syed-Masrur-Ahmed/GitGud.git
cd GitGud
pip install -e .

Optional: AI Enhancement

For experimental AI-powered features, install Ollama:

# Install Ollama (https://ollama.ai)
ollama pull codellama:7b

AI features are optional - GitGud works great with smart heuristics alone.

Usage

# Navigate to any Git repository
cd your-git-repo

# Check repository health
gitgud status

# Commit with auto-generated message
gitgud commit

# Commit with AI enhancement (experimental)
gitgud commit --ai

# Commit with manual message
gitgud commit -m "your message"

# Smart push
gitgud push

# Resolve divergent branches
gitgud resolve

# Show help
gitgud --help

Commands

Command Description
gitgud status Show repository health dashboard
gitgud commit Create commit with smart message generation
gitgud push Intelligent push with analysis
gitgud resolve Interactive divergent branch helper

Tech Stack

  • Python 3.9+
  • Click - CLI framework
  • Rich - Beautiful terminal output
  • GitPython - Git integration
  • Ollama - Optional AI enhancement (local, private)

How It Works

GitGud analyzes your repository using:

  1. Git state inspection - branches, commits, changes
  2. Pattern recognition - detects common scenarios
  3. Smart heuristics - rule-based recommendations
  4. Optional AI - LLM-powered insights (experimental)

All analysis happens locally. No data is sent to external services.

Configuration

GitGud works out of the box with sensible defaults. No configuration needed.

For AI features, ensure Ollama is running:

ollama serve

Contributing

Contributions welcome! Please feel free to submit issues and pull requests.

License

MIT License - see LICENSE file for details.

Author

Syed Masrur Ahmed


Make Git effortless. Install GitGud today!

pip install gitgud-cli

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

gitgud_cli-1.0.5.tar.gz (23.6 kB view details)

Uploaded Source

Built Distribution

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

gitgud_cli-1.0.5-py3-none-any.whl (27.7 kB view details)

Uploaded Python 3

File details

Details for the file gitgud_cli-1.0.5.tar.gz.

File metadata

  • Download URL: gitgud_cli-1.0.5.tar.gz
  • Upload date:
  • Size: 23.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for gitgud_cli-1.0.5.tar.gz
Algorithm Hash digest
SHA256 b7815106344ee4ddf4ac64e7624cfd790bc781f4f634b063e449732d5857b630
MD5 ee5d05af4dad3331375e2c32ec7ba298
BLAKE2b-256 e88338afdf885c3d4867950fc6d8473c85714b32189d9ad3493595129d76954a

See more details on using hashes here.

File details

Details for the file gitgud_cli-1.0.5-py3-none-any.whl.

File metadata

  • Download URL: gitgud_cli-1.0.5-py3-none-any.whl
  • Upload date:
  • Size: 27.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for gitgud_cli-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 4c3e7927993f9ffe72288f0fd20b04130e1db78215faf44506706b492c56a056
MD5 2688488ba1f914e4edc5e02e99e597bc
BLAKE2b-256 edab7411b3092f804bcc163dbcb81ca17987740d321846530c728fd0a2992b07

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