Note: This project is based on the tutorial "Visualize your local Git contributions with Go" by Flavio Copes. The original tutorial provides a comprehensive guide on building a Git stats analysis CLI tool using Go.
A powerful Go application that analyzes your local Git repositories and generates a beautiful GitHub-style contribution graph showing your coding activity over the last 6 months. Perfect for developers who want to track their local development activity across multiple repositories!
- π Smart Repository Discovery - Recursively scans directories for Git repositories
- π GitHub-Style Visualization - Beautiful contribution graph with colored cells
- π 6-Month Activity Overview - Complete view of your coding patterns
- π¨ Intelligent Color Coding - White, yellow, green based on activity levels
- β‘ Lightning Fast - Processes hundreds of repositories efficiently
- π‘οΈ Robust Error Handling - Gracefully handles problematic repositories
- π― Email Filtering - Focus on your specific contributions
- π± Cross-Platform - Works on macOS, Linux, and Windows
- Track Your Progress - See your coding activity patterns over time
- Local Development Focus - Analyze repositories not on GitHub
- Multiple Repository Support - Get insights across all your projects
- Beautiful Output - GitHub-style graphs in your terminal
- Privacy First - All analysis happens locally on your machine
- Go 1.24.5 or higher
- Git repositories on your local machine
- Clone the repository:
git clone https://github.com/banghuazhao/go_git_local_status.git
cd go_git_local_status- Install dependencies:
go mod tidy- Run the tool:
go run . -folder "/path/to/your/projects" -email "your.email@example.com"Example output showing a GitHub-style contribution graph generated from local Git repositories
-: No commits (gray)1-4: Light activity (white background)5-9: Medium activity (yellow background)10+: High activity (green background)
-folder string: Directory to scan for Git repositories-email string: Email address to filter commits (default: "your@email.com")
- Repository Discovery: Recursively scans the specified directory for
.gitfolders - Commit Analysis: For each repository, reads the Git history and filters commits by email
- Date Calculation: Calculates days since each commit and applies offset for proper graph alignment
- Graph Generation: Creates a GitHub-style contribution graph with color-coded cells
- Output Display: Shows the graph with month labels and day-of-week alignment
go_git_local_status/
βββ main.go # Main entry point and flag parsing
βββ scan.go # Repository discovery and Git folder scanning
βββ stats.go # Commit analysis and graph generation
βββ screenshots/ # Example outputs and documentation
βββ go.mod # Go module dependencies
βββ go.sum # Dependency checksums
βββ README.md # This file
- go-git/go-git/v5 - Git repository operations
- Standard Go libraries (flag, fmt, log, os, strings, time)
The application gracefully handles:
- Empty Git repositories
- Repositories without HEAD references
- Corrupted Git repositories
- Permission errors
- Invalid repository paths
- Processes multiple repositories efficiently
- Skips problematic repositories without stopping
- Memory-efficient commit iteration
- Fast directory scanning
We love contributions! Here's how you can help:
- β Star this repository if you find it useful
- π Report bugs by opening an issue
- π‘ Suggest features through issues
- π§ Submit pull requests for improvements
- π Improve documentation
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes
- Add tests if applicable
- Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
This project is open source and available under the MIT License.
Created by @banghuazhao
- π GitHub: @banghuazhao
- π More Projects: Check out my other repositories for more amazing tools!
If this project helps you track your development activity, please consider:
- β Starring this repository
- π₯ Following me on GitHub
- π Reporting bugs or suggesting features
- π¬ Sharing with your developer friends
π‘ Pro Tip: This tool is perfect for developers who work across multiple local repositories and want to visualize their coding patterns, similar to GitHub's contribution graph but for your local development environment.
π― Perfect For: Software engineers, developers, and anyone who wants to track their local Git activity patterns!
