git-branch-master
v0.1.0
Published
Smart CLI tool for efficient Git branch management with interactive TUI
Maintainers
Readme
🌿 Git Branch Master
A smart CLI tool for efficient Git branch management. Find recent branches instantly and clean up old ones safely.
🎯 Why Git Branch Master?
Ever struggled to remember which branch you were working on yesterday? Or accumulated dozens of old branches that clutter your repository? Git Branch Master solves these daily frustrations with an intuitive TUI.
Key Features
- 🔍 Recent Branches - Instantly find and switch to recently used branches
- 🧹 Smart Cleanup - Safely identify and remove merged/old branches
- 🔄 Rollback Protection - Restore accidentally deleted branches
- ⚙️ Configurable Base - Set your own base branch for comparisons
- ✨ Beautiful TUI - Interactive interface built with Ink
📦 Installation
npm install -g git-branch-master
# or
pnpm add -g git-branch-master🚀 Quick Start
# Interactive menu
gbm
# Show recent branches
gbm recent
# Clean up old branches
gbm clean
# Configure base branch
gbm config📖 Commands
gbm recent
Shows your recently accessed branches with activity indicators:
- Unmerged branches are prioritized
- Shows ahead/behind counts relative to base
- Quick branch switching with arrow keys
gbm clean
Analyzes branches for safe cleanup:
- Safe: Merged branches older than 30 days
- Review: Unmerged branches older than 90 days
- Protected: Never deletes main/master branches
- Full branch list (no hiding with "more")
gbm rollback [branch-name]
Recover deleted branches:
- List all recently deleted branches
- Restore specific branch by name
- Backups kept for 30 days
gbm config
Configure base branch:
- Auto-detects default branch from origin
- Set custom base branch for comparisons
- Reset to auto-detected default
⚡ Options
-b, --base <branch> Use specific branch as base (default: auto-detect)
-h, --help Show help🎨 Branch Categories
Branches are categorized by activity:
- Recent: < 7 days
- Stale: 7-30 days
- Old: 30-90 days
- Ancient: > 90 days
And by type:
- Local-only: No remote tracking
- Not-merged: Has remote but not merged
- Merged: Fully merged into base
- Protected: Default branches (main/master)
⚙️ Configuration
Settings are stored in ~/.git-branch-master/config.json:
{
"baseBranch": "develop" // Optional, defaults to auto-detect
}🛡️ Safety Features
- Never deletes current branch
- Protects default branches (main/master)
- Local-only branches clearly marked
- Rollback system for recovery
- Confirmation before bulk operations
🤝 Contributing
Contributions are welcome! Please read our Contributing Guide first.
# Clone the repository
git clone https://github.com/kangju2000/git-branch-master.git
# Install dependencies
pnpm install
# Run development
pnpm dev
# Run tests
pnpm test
# Build
pnpm build📄 License
MIT © kangju2000
