An enhanced Git tool built with Rust that provides AI-powered commit messages, interactive branch management, and GitHub PR integration.
- 🤖 AI-powered commit messages - Generate conventional commit messages using AI
- 🌿 Interactive branch management - Easy branch switching with a visual picker
- 📊 Branch statistics with GitHub PR tracking - View branch status, merge state, and associated GitHub PRs
- 🗑️ Smart branch pruning - Clean up merged branches with safety checks and interactive selection
- 🔗 GitHub integration - Automatically detect and display pull request information
- 🚀 Git passthrough - Works seamlessly with existing git workflows
cargo install xgitTo update to the latest version:
cargo install xgit --forceNote: The --force flag is required to overwrite the existing installation.
Select and switch between branches interactively:
xgit branch
# or use the short alias:
xgit bView comprehensive branch information including GitHub PR status:
xgit branch --stats
# or use the short alias:
xgit b --statsClean up branches that have been merged to main:
# Preview what would be deleted (recommended first)
xgit branch --prune-merged --dry-run
# or use the short alias:
xgit b --prune-merged --dry-run
# Interactive deletion - select which branches to remove
xgit branch --prune-merged
# or use the short alias:
xgit b --prune-mergedGenerate commit messages automatically using AI:
# Stage your changes first
git add .
# Use AI to generate commit message
xgit commit
# or use the short alias:
xgit cUse any git command through xgit:
xgit status
xgit log
xgit push
# ... any git commandxgit automatically detects GitHub repositories and fetches PR information for each branch. Authentication options:
- Environment variable: Set
GITHUB_TOKEN - Unauthenticated: Works with public repos (rate limited)
-
Clone the repository:
git clone https://github.com/LiXuanqi/gitx cd xgit -
Install git hooks (recommended):
./scripts/install-hooks.sh
-
Build and test:
cargo build cargo test cargo clippy --all-targets -- -D warnings
-
Create and push a version tag:
git tag v0.2.5 git push origin v0.2.5
-
Create the GitHub release:
gh release create v0.2.5 --title "v0.2.5" --notes "Release notes here"
Or auto-generate notes:
gh release create v0.2.5 --generate-notes