@git-changes for uncommitted changes or @[commit-hash] for specific commits. When you mention git information, Elastic sees complete diffs, commit messages, and other relevant repository information.
How Git Mentions Work
Git mentions provide different types of repository context:- Uncommitted changes:
@git-changesshows all modified files - Specific commits:
@[commit-hash]shows commit details - Branch information: Context about current branch and status
- Diff information: Complete file changes and modifications
Syntax
Uncommitted Changes
Specific Commits
@git-changes- All uncommitted modifications@[a1b2c3d]- Specific commit by hash@[a1b2c3d4e5f6]- Full commit hash
What Elastic Sees
For Uncommitted Changes (@git-changes)
- Modified files - All files with changes
- Complete diffs - Line-by-line changes
- Added files - New files in the repository
- Deleted files - Files removed from the repository
- Staged vs unstaged - Status of changes
For Specific Commits (@[hash])
- Commit message - Full commit description
- Author information - Who made the commit
- Timestamp - When the commit was made
- File changes - Complete diff of the commit
- Parent commits - Commit history context
Best Practices
When to Use Git Mentions
- Code review:
@git-changes Review my recent changes - Commit preparation:
@git-changes Help me write a good commit message - Bug investigation:
@[abc123] This commit introduced a bug - Feature analysis:
@git-changes Explain what this feature does - Merge conflicts:
@git-changes Help resolve these conflicts
Combining with File Mentions
Target specific files in your changes:Combining with Problem Mentions
Check if changes introduce issues:Common Git Scenarios
Pre-commit Review
Commit Message Help
Bug Investigation
Feature Understanding
Merge Conflict Resolution
Types of Git Information
File Status
- Modified: Files with changes
- Added: New files
- Deleted: Removed files
- Renamed: Files moved or renamed
- Copied: Files duplicated
Change Types
- Additions: New lines of code
- Deletions: Removed lines
- Modifications: Changed lines
- Moves: File relocations
- Permission changes: File mode updates
Repository Context
- Current branch: Active branch name
- Commit history: Recent commits
- Remote status: Sync with remote repository
- Stash information: Saved changes
Tips for Effective Git Mentions
- Review before committing: Use
@git-changesto review all changes - Investigate specific commits: Use commit hashes to understand changes
- Combine with other mentions: Add file or problem mentions for context
- Check for conflicts: Ensure changes don’t introduce issues
- Document changes: Get help writing clear commit messages
Integration with Memory Bank
Git mentions help Elastic understand:- Your coding patterns: How you make changes
- Commit style: Your preferred commit message format
- Development workflow: How you use git in your process
- Code evolution: How your project changes over time
Advanced Git Use Cases
Release Preparation
Code History Analysis
Refactoring Review
Performance Impact
Security Review
Combining with Other Mentions
With File Mentions
With Folder Mentions
With Terminal Mentions
With Problem Mentions
Git Mention Limitations
Large Changes
- Very large diffs might be summarized
- Focus on the most important changes
- Use file mentions to target specific areas
Binary Files
- Binary file changes are typically excluded
- Focus on text-based changes
- Mention specific binary files if needed
Sensitive Information
- Be careful with commits containing:
- API keys or secrets
- Personal information
- Internal system details
Troubleshooting Git Mentions
No Git Changes
If@git-changes shows nothing:
- Check if you have uncommitted changes
- Verify you’re in a git repository
- Make sure files are tracked by git
- Try
git statusto confirm changes
Commit Not Found
If@[hash] doesn’t work:
- Verify the commit hash is correct
- Check if the commit exists in current branch
- Try the full commit hash instead of short version
- Ensure you’re in the correct repository
Incomplete Information
If git mentions seem limited:- Use specific commit hashes for detailed info
- Combine with file mentions for context
- Ask for specific aspects of the changes
- Break down large changes into smaller parts