# git-counter
**Repository Path**: binbin0915_admin/git-counter
## Basic Information
- **Project Name**: git-counter
- **Description**: No description available
- **Primary Language**: Unknown
- **License**: MIT
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 2
- **Created**: 2025-11-06
- **Last Updated**: 2025-11-06
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# π Git Code Statistics Tool
**A powerful and easy-to-use Git code contribution statistics tool**
[](https://www.python.org/downloads/)
[](LICENSE)
[](https://github.com)
[δΈζζζ‘£](README.md) | English
---
## π― Pain Points Solved
Have you ever encountered these problems in development?
- β **Performance Review**: Need to count personal or team code contributions to prove work achievements
- β **Project Evaluation**: Want to know each developer's actual contribution ratio in the project
- β **Code Review**: Need to quickly understand how much code a developer wrote and its quality
- β **Multi-Account Management**: Same person uses different Git accounts for commits, scattered statistics
- β **Report Generation**: Need to generate professional statistical reports for leaders or clients
- β **Code Quality**: Want to know if code was written once or went through extensive refactoring
**This tool solves all the above problems in one stop!** π
---
## β¨ Core Features
### π₯οΈ Dual Mode Support
- **GUI Interface** - Zero threshold, just click (Recommended)
- **Command Line** - Suitable for automation scripts
### π₯ Flexible User Configuration
- **Auto Detection** - Read local Git repository configuration
- **Manual Specification** - Support any username/email
- **Multi-Account Stats** - Analyze multiple accounts at once
- **Per-Account Mode** - Separate statistics for each account with automatic comparison
### π Dual Statistical Dimensions
1. **Cumulative Workload** - Based on `git diff`, counts code changes in commit history
2. **Current Code Amount** - Based on `git blame`, counts lines you actually own in current repo
3. **Work Efficiency Ratio** - Auto-calculate `Cumulative / Current`, evaluate code quality
> **Efficiency Ratio Interpretation:**
> - **> 150%**: Extensive refactoring and optimization (high quality)
> - **110-150%**: Moderate refactoring, stable code
> - **90-110%**: Written once, few changes
> - **< 90%**: Possibly rewrote a lot of others' code
### π¨ Beautiful Report Export
- **HTML Report** - Visual charts (pie chart, comparison table), professional
- **Excel Report** - Multi-sheet (summary, details, per-account, comparison)
- **Text Report** - Console preview, quick view
### π§ Smart Analysis
- **Auto Exclude Comments** - Support 20+ programming languages
- **Frontend/Backend Classification** - Auto-identify file types
- **File-Level Statistics** - Detailed lines for each file + leaderboard
- **Smart Cache** - Auto-cache results, greatly improve analysis speed
---
## π Quick Start
### Method 1: Use Packaged EXE (Recommended, no Python required)
1. Download [Latest Release](https://github.com/your-username/git-counter/releases)
2. Double-click `GitCounter.exe`
3. Select repository β Start analysis β Export report
**That simple!** π
### Method 2: Run from Source
```bash
# Clone repository
git clone https://github.com/your-username/git-counter.git
cd git-counter
# Install dependencies
pip install -r requirements.txt
# Run GUI version
python git_counter_gui.py
```
---
## π‘ Use Cases
### Scenario 1: Personal Performance Review
- Export HTML report for annual review
- Visualize code contributions clearly
### Scenario 2: Team Contribution Comparison
- Input all team members' Git accounts
- Select "Detailed Mode"
- Get comparison table + pie chart
### Scenario 3: Code Quality Assessment
- Check "Work Efficiency Ratio"
- Compare "Cumulative" vs "Current"
- Evaluate refactoring extent
### Scenario 4: Multi-Account Merge Statistics
- Input multiple Git accounts
- Select "Summary Mode"
- Auto-merge all contributions
---
## π Documentation
- [π User Guide](δ½Ώη¨ζε.md) (Chinese)
- [π§ Developer Docs](εΌεζζ‘£.md) (Chinese)
- [π Statistics Principle](STATISTICS_PRINCIPLE.md) (Chinese)
---
## π οΈ Tech Stack
- **Core**: Python 3.7+
- **GUI**: Tkinter (standard library)
- **Git Operations**: GitPython
- **Excel Export**: openpyxl
- **Packaging**: PyInstaller
---
## π€ Contributing
Contributions are welcome! See [CONTRIBUTING.md](CONTRIBUTING.md) for details.
---
## π Changelog
### v2.3.0 (2025-11-03)
- β¨ Added: Smart cache mechanism
- β¨ Added: Cache validation (detect new commits, branch switch, etc.)
- π Fixed: Dependency issues when packaging EXE
- π§ Optimized: Cache directory moved to user home
---
## π License
[MIT License](LICENSE) Β© 2025
---
**If you find this helpful, please give it a Star β**
Made with β€οΈ by [Your Name](https://github.com/your-username)