xgit

Crates.ioxgit
lib.rsxgit
version0.2.3
created_at2025-07-14 00:33:10.700795+00
updated_at2025-08-11 00:04:02.064283+00
descriptionA enhanced AI-powered Git tool
homepagehttps://github.com/LiXuanqi/xgit
repositoryhttps://github.com/LiXuanqi/xgit
max_upload_size
id1750942
size182,120
1_x7 (LiXuanqi)

documentation

README

xgit

An enhanced Git tool built with Rust that provides AI-powered commit messages, interactive branch management, and GitHub PR integration.

Features

  • 🤖 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

Installation

cargo install xgit

Updating

To update to the latest version:

cargo install xgit --force

Note: The --force flag is required to overwrite the existing installation.

Usage

Interactive Branch Switching

Select and switch between branches interactively:

xgit branch
# or use the short alias:
xgit b

Branch Statistics & GitHub PR Tracking

View comprehensive branch information including GitHub PR status:

xgit branch --stats
# or use the short alias:
xgit b --stats

Smart Branch Pruning

Clean 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-merged

AI-Powered Commits

Generate 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 c

Git Passthrough

Use any git command through xgit:

xgit status
xgit log
xgit push
# ... any git command

GitHub Integration

xgit automatically detects GitHub repositories and fetches PR information for each branch. Authentication options:

  1. Environment variable: Set GITHUB_TOKEN
  2. Unauthenticated: Works with public repos (rate limited)

Development

  1. Clone the repository:

    git clone https://github.com/LiXuanqi/gitx
    cd xgit
    
  2. Install git hooks (recommended):

    ./scripts/install-hooks.sh
    
  3. Build and test:

    cargo build
    cargo test
    cargo clippy --all-targets -- -D warnings
    
Commit count: 0

cargo fmt