╔═══════════════════════════════════════════════════════════════╗
║ ║
║ ██████╗ ██╗████████╗███████╗██╗ ██╗███╗ ███╗ ║
║ ██╔════╝ ██║╚══██╔══╝██╔════╝██║ ██║████╗ ████║ ║
║ ██║ ███╗██║ ██║ ███████╗██║ ██║██╔████╔██║ ║
║ ██║ ██║██║ ██║ ╚════██║██║ ██║██║╚██╔╝██║ ║
║ ╚██████╔╝██║ ██║ ███████║╚██████╔╝██║ ╚═╝ ██║ ║
║ ╚═════╝ ╚═╝ ╚═╝ ╚══════╝ ╚═════╝ ╚═╝ ╚═╝ ║
║ ║
║ Git Repository Intelligence & Insights ║
╚═══════════════════════════════════════════════════════════════╝
Analyze any Git repository and generate intelligent summaries with LLM-powered insights.
Features • Installation • Usage • Examples • Architecture • Contributing • Support
Ever joined a new project and wondered:
- 🤔 "What's the commit history like?"
⚠️ "Which files are the riskiest?"- 👥 "Who knows what in this codebase?"
- 📊 "What patterns do the commits follow?"
Git Summarizer answers all these questions in seconds, providing actionable insights through beautiful terminal output and optional LLM-powered summaries.
- Total commits, authors, and timeline
- Commit tempo (daily/weekly/monthly averages)
- Longest inactive periods
- Code churn statistics
- Identify high-impact commits
- Track large diffs and refactors
- Calculate commit "impact scores"
Score files by:
- Change frequency
- Total lines modified
- Number of contributors
- Recency of changes
- Estimated complexity
- Top contributors by commits and lines
- File ownership mapping
- Knowledge concentration analysis
- Bus factor calculation
- Detect keywords:
fix,feat,refactor,docs, etc. - Generate frequency tables
- Identify team conventions
- Unusually large commits
- Commit spikes
- Suspicious patterns
- Executive summaries for leadership
- Technical deep-dives for engineers
- Risk-focused reports
- Comprehensive analysis
pip install git-summarizergit clone https://github.com/git-summarizer/git-summarizer.git
cd git-summarizer
pip install -e .pip install -e ".[dev]"# Analyze current directory
gitsum summarize .
# Analyze a specific repository
gitsum summarize ~/projects/my-repo
# Analyze with commit limit
gitsum summarize . --limit-commits 500Analyze any public Git repository directly by URL:
# GitHub repositories
gitsum summarize https://github.com/fastapi/fastapi
# GitLab repositories
gitsum summarize https://gitlab.com/gitlab-org/gitlab
# BitBucket repositories
gitsum summarize https://bitbucket.org/user/repo
# Shallow clone for faster analysis (last 100 commits)
gitsum summarize https://github.com/user/repo --shallow
# Custom clone depth
gitsum summarize https://github.com/user/repo --clone-depth 500# Use different LLM provider
gitsum summarize . --provider openai
# Choose summary style
gitsum summarize . --style executive # For leadership
gitsum summarize . --style technical # For engineers
gitsum summarize . --style risk # Risk-focused
gitsum summarize . --style comprehensive # Everything (default)
# Export to JSON
gitsum summarize . --json output.json
# Skip LLM summarization
gitsum summarize . --no-llm
# Enable debug mode
gitsum summarize . --debug# Set OpenAI API key for LLM summaries
export OPENAI_API_KEY=sk-your-key-here$ gitsum summarize .Output:
╔═══════════════════════════════════════════════════════════════╗
║ ██████╗ ██╗████████╗███████╗██╗ ██╗███╗ ███╗ ║
║ ██╔════╝ ██║╚══██╔══╝██╔════╝██║ ██║████╗ ████║ ║
║ ... ║
╚═══════════════════════════════════════════════════════════════╝
Analyzing repository: /home/user/my-project
✓ Loaded 1,247 commits
═════════════════════════════════════════════════════════════════
╭──────────────────── 📜 Git History Summary ────────────────────╮
│ ╭────────────────────┬─────────────────────────────────╮ │
│ │ 📊 Total Commits │ 1,247 │ │
│ │ 👥 Contributors │ 23 │ │
│ │ 📅 First Commit │ 2021-03-15 │ │
│ │ 📅 Last Commit │ 2024-11-24 │ │
│ │ 📈 Daily Avg │ 0.93 commits │ │
│ │ 📈 Weekly Avg │ 6.5 commits │ │
│ │ ⏸️ Longest Gap │ 45 days │ │
│ │ ➕ Lines Added │ 156,234 │ │
│ │ ➖ Lines Deleted │ 89,102 │ │
│ ╰────────────────────┴─────────────────────────────────╯ │
╰────────────────────────────────────────────────────────────────╯
⚠️ Riskiest Files
┏━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━┳━━━━━━━━━┳━━━━━━━━━━┓
┃ File ┃ Risk ┃ Changes ┃ Authors ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━╇━━━━━━━━━╇━━━━━━━━━━┩
│ src/core/engine.py │ 87.3 │ 156 │ 8 │
│ src/api/handlers.py │ 72.1 │ 89 │ 6 │
│ src/utils/helpers.py │ 65.4 │ 67 │ 5 │
└──────────────────────────┴──────┴─────────┴──────────┘
📝 Commit Message Patterns
fix ████████████████████░░░░░░░░░░ 312 (25.0%)
feat █████████████░░░░░░░░░░░░░░░░░ 198 (15.9%)
refactor ████████░░░░░░░░░░░░░░░░░░░░░░ 124 (9.9%)
docs ██████░░░░░░░░░░░░░░░░░░░░░░░░ 89 (7.1%)
test █████░░░░░░░░░░░░░░░░░░░░░░░░░ 78 (6.3%)
🚌 Bus Factor: 3
See EXAMPLES.md for more detailed examples.
┌─────────────────────────────────────────────────────────────┐
│ CLI Layer │
│ (Typer + Rich UI) │
├─────────────────────────────────────────────────────────────┤
│ Core Analyzers │
│ ┌─────────────┐ ┌──────────────┐ ┌──────────────────┐ │
│ │ GitAnalyzer │ │ RiskAnalyzer │ │ ContributorAnalyzer│ │
│ └─────────────┘ └──────────────┘ └──────────────────┘ │
├─────────────────────────────────────────────────────────────┤
│ LLM Provider Layer │
│ ┌─────────────────┐ ┌──────────────────────────────┐ │
│ │ BaseProvider │ │ OpenAIProvider │ │
│ │ (Abstract) │ │ (GPT-4o-mini) │ │
│ └─────────────────┘ └──────────────────────────────┘ │
├─────────────────────────────────────────────────────────────┤
│ Data Models │
│ (Pydantic: CommitInfo, RiskFile, etc.) │
├─────────────────────────────────────────────────────────────┤
│ Git Backend │
│ (GitPython) │
└─────────────────────────────────────────────────────────────┘
See ARCHITECTURE.md for detailed design documentation.
Git Summarizer uses a pluggable provider system for LLM integration:
| Provider | Model | Description |
|---|---|---|
openai |
gpt-4o-mini | Default, high-quality summaries |
from gitsum.providers.base import BaseProvider, SummaryStyle
class MyProvider(BaseProvider):
def generate_summary(self, sections: dict, style: SummaryStyle) -> str:
# Your implementation
pass
def is_available(self) -> bool:
# Check if provider is configured
return True# Run all tests
pytest
# Run with coverage
pytest --cov=gitsum
# Run specific test file
pytest tests/test_analyzer.pyWe welcome contributions! Here's how to get started:
- Fork the repository
- Create a feature branch
git checkout -b feature/amazing-feature
- Make your changes
- Run tests
pytest
- Submit a pull request
- Follow PEP 8 style guide
- Use Black for formatting
- Add tests for new features
- Update documentation as needed
If this repo saved you time or sparked an idea, consider buying me a coffee to keep the prompts flowing. ❤️
https://buymeacoffee.com/connectankush
Your support and feedback are valuable in maintaining and improving the extension.
This project is licensed under the MIT License - see the LICENSE file for details.
- GitPython for Git repository access
- Typer for CLI framework
- Rich for beautiful terminal output
- OpenAI for LLM capabilities
Made with ❤️ by Ankush