ggo - Smart Git Navigation
A
zoxide-style tool for intelligent git branch navigation with frecency-based ranking and aliases
What is ggo?
ggo makes git branch navigation as intuitive as zoxide makes directory navigation. Instead of typing full branch names or using tab completion, ggo learns from your habits and gets you where you need to go with minimal keystrokes.
Key Features:
- 🚀 Smart matching: Fuzzy search finds branches even with typos
- 🧠 Learns from you: Frecency algorithm ranks frequently-used branches higher
- ⚡ Aliases: Create shortcuts like
ggo m→master - 🎯 Intelligent selection: Auto-selects when there's a clear winner (2x score threshold)
- 💾 Previous branch: Jump back with
ggo -(likecd -) - 📊 Statistics: Track your branch usage patterns
Installation
Homebrew (macOS/Linux) - Recommended
Or add the tap first:
Fast installation (~2 seconds) with pre-built binaries. No Rust required!
Cargo (Rust Users)
Quick Install Script
|
This script will:
- Detect your OS and architecture
- Install Rust if needed (via rustup)
- Try installing from crates.io first (faster)
- Fall back to building from source if needed
- Install to
~/.local/bin(customizable withGGO_INSTALL_DIR)
From Source
Requirements
- Git 2.0+
- For non-Homebrew installs: Rust 1.70+ (stable)
Quick Start
# Checkout branch with fuzzy matching
# List matching branches with scores
# Create an alias
# Go back to previous branch
# View your usage statistics
Usage
Basic Branch Checkout
Listing Branches
Branch Aliases
# Create aliases for frequently-used branches
# Use aliases
# Manage aliases
Flags & Options
How It Works
Frecency Algorithm
ggo combines frequency (how often you use a branch) with recency (how recently you used it):
- Used in last hour: 4.0x weight
- Used in last day: 2.0x weight
- Used in last week: 1.0x weight
- Used in last month: 0.5x weight
- Older: 0.25x weight
Your most frequently AND recently used branches automatically rank higher.
Intelligent Auto-Selection
When multiple branches match your pattern:
- Clear winner (≥2x score difference) → Auto-selects
- Close scores (<2x difference) → Shows interactive menu
This means fewer prompts when the answer is obvious, but still gives you choice when it matters.
Per-Repository Aliases
Aliases are scoped per-repository, so ggo m can mean:
masterin your backend repomainin your frontend repodevelopin your experimental repo
Configuration
Database Location
ggo stores branch history and aliases in:
~/.config/ggo/data.db (Linux/macOS)
The database uses SQLite with automatic migrations, so upgrading ggo won't lose your history.
Data Tracked
For each branch checkout, ggo records:
- Repository path
- Branch name
- Switch count (frequency)
- Last used timestamp (recency)
No sensitive data is collected. Everything stays local.
Examples
Typical Workflow
# First time using ggo - just type what you remember
# Shows interactive menu if multiple 'feature' branches exist
# After a few uses, ggo learns your preference
# Auto-selects your most-used feature branch
# Create aliases for your main branches
# Now super fast navigation
With Multiple Projects
# In project A
# In project B (different repo)
Troubleshooting
"Not a git repository"
Make sure you're running ggo from within a git repository:
"No branches found matching..."
Try:
- Using a shorter pattern:
ggo feainstead ofggo feature-auth-v2 - Listing all branches:
ggo --list "" - Using case-insensitive mode:
ggo -i FEATURE
Branch history not tracking
Check database permissions:
# Should be readable and writable
Frecency scores seem wrong
ggo ranks by usage patterns. If you just created a branch, it won't rank high yet. Use it a few times and it will climb the rankings.
Development
Running Tests
Linting
Building
Project Structure
ggo/
├── src/
│ ├── main.rs # CLI entry and main logic
│ ├── cli.rs # Command-line argument parsing
│ ├── git.rs # Git operations wrapper
│ ├── matcher.rs # Fuzzy and exact matching
│ ├── storage.rs # SQLite database layer
│ ├── frecency.rs # Frecency scoring algorithm
│ └── interactive.rs # Terminal UI for selection
├── tests/
│ └── integration_tests.rs
├── ROADMAP.md # Feature roadmap
├── TECHNICAL_DEBT.md # Known issues and improvements
└── README.md # This file
Roadmap
See ROADMAP.md for the full feature roadmap.
Current Status: Phase 3 (Fuzzy Matching + Aliases)
Completed:
- ✅ Phase 1: Basic pattern matching
- ✅ Phase 2: Frecency & smart ranking
- ✅ Phase 3: Fuzzy matching & interactive mode
- ✅ Phase 5 (partial): Branch aliases
Upcoming:
- Phase 4: Repository tracking
- Phase 5: Advanced features (statistics, team sync)
Contributing
Contributions are welcome! Please:
- Check TECHNICAL_DEBT.md for known issues
- Write tests for new features
- Run
cargo testandcargo clippybefore submitting - Follow the existing code style
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
Inspired by zoxide - the smarter cd command.
Made with ❤️ by Xavier Fabregat