gg log
Display commit history with optional AI analysis.
Usage
bash
gg log # Show last 10 commits
gg log -n 20 --ai # Show 20 commits with AI analysis
gg log --graph # Show with visual graphOptions
| Option | Description |
|---|---|
-n <count> | Number of commits to show (default: 10) |
-g, --graph | Show commit graph |
--ai | Generate AI analysis of commit history |
--no-ai | Disable AI analysis |
-d, --dry-run | Show what would be executed |
AI Analysis
When using the --ai flag, GitGuru provides intelligent insights about your commit history:
- Development patterns - How work is distributed over time
- Key themes - Common topics in recent commits
- Commit quality assessment - How well commits follow best practices
- Recommendations - Suggestions for improvement
bash
$ gg log -n 20 --ai
š Commit History Analysis
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
Recent Commits (20):
abc1234 feat: add user authentication
def5678 fix: resolve login redirect issue
ghi9012 docs: update API documentation
...
š¤ AI Analysis:
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
Development Patterns:
⢠Active development on authentication feature
⢠Regular bug fixes following feature commits
⢠Good documentation updates
Key Themes:
⢠User authentication (40%)
⢠Bug fixes (30%)
⢠Documentation (20%)
⢠Refactoring (10%)
Commit Quality: Good ā
⢠Using conventional commit format
⢠Descriptive messages
⢠Focused changes
Recommendations:
š” Consider adding more tests alongside features
š” Some commits could be more atomicExamples
Basic Usage
bash
# Show last 10 commits
gg log
# Show last 50 commits
gg log -n 50
# Show with graph visualization
gg log --graphWith AI Analysis
bash
# Analyze recent history
gg log --ai
# Analyze more commits for better patterns
gg log -n 50 --aiPattern Detection
For the best AI analysis, use
-n 30 or higher. More commits give the AI better context to identify patterns and trends.Visual Graph
The --graph option shows a visual representation of your branch structure:
bash
$ gg log --graph
* abc1234 (HEAD -> main) feat: add dashboard
* def5678 Merge branch 'feature/auth'
|\
| * ghi9012 feat: complete login flow
| * jkl3456 feat: add auth middleware
|/
* mno7890 initial commitUse Cases
Morning Team Review
bash
# See what the team did yesterday
gg log -n 30 --aiPre-Merge Review
bash
# Review commits before merging
gg log --graph
gg log -n 10 --aiFind Specific Commits
bash
# Use gg ask for specific queries
gg ask "find commits that changed login.ts"
gg ask "show commits by John from last week"