A Git plugin for cleaning up merged git branches interactively using fuzzy finder.
Works as a native Git extension: git gone
- π Updates all local references with origin
- π― Detects branches ready for deletion using multiple methods:
- Branches merged into the default branch (traditional merge)
- Branches with deleted remotes (squash/rebase merges)
- Platform-independent operation (works regardless of system language)
- π Interactive multi-selection using go-fzf
- β Safe deletion with confirmation prompt
- π Clear status indicators throughout the process
- π Generate detailed branch analysis reports (text/JSON/CSV)
brew install theburrowhub/tap/git-goneOr first tap the repository and then install:
brew tap theburrowhub/tap
brew install git-gone# Download and run the installation script
# Will download pre-built binary if available, or build from source automatically
curl -sSL https://raw.githubusercontent.com/theburrowhub/git-gone/main/install.sh | bashNote: The installation script will automatically:
- Try to download pre-built releases if available
- Fall back to building from source if no releases exist (requires Git and Go 1.19+)
- Install the binary to
~/.local/binby default
# Clone the repository
git clone https://github.com/theburrowhub/git-gone.git
cd git-gone
# Use the installation script for local build
./install.sh
# Or build manually
go build -o git-gone
sudo mv git-gone /usr/local/bin/Download the latest release from the releases page for your platform.
Navigate to any git repository and run:
git gone
# or
git-gone
# or explicitly
git-gone branchesgit-goneorgit-gone branches: Clean up merged branches (default)git-gone report: Generate branch analysis report without deletinggit-gone version: Show version informationgit-gone help: Show help information
- Update all remote references (
git fetch --all --prune) - Identify the default branch (main/master)
- Find deletable branches using two methods:
- Branches merged into the default branch (traditional merges)
- Branches whose remote tracking branch is gone (squash/rebase merges)
- Present an interactive list where you can:
- Use arrow keys to navigate
- Press
TaborSpaceto select/deselect branches - Press
Enterto confirm selection - Press
Escto cancel - Type to filter branches by name
- Ask for confirmation before deleting selected branches
- Delete the selected branches safely
Generate a detailed analysis report without deleting any branches:
git-gone report# Text format (default)
git-gone report --output text
# JSON format (for scripting/automation)
git-gone report --output json
git-gone report -o json
# CSV format (for spreadsheets)
git-gone report --output csvgit-gone report --output json --file report.jsongit-gone report --unmerged
git-gone report -uThe report classifies branches into:
- Safe to Delete: Merged branches or branches with deleted remotes
- Local-only: Merged but never pushed to remote (review recommended)
- Unmerged: Not merged, requires
--unmergedflag to include - Protected: Default branch or currently checked out
============================================================
GIT-GONE BRANCH ANALYSIS REPORT
============================================================
Repository: /path/to/repo
Date: 2026-01-09 14:30:00
Default Branch: main
Current Branch: feature/ui
------------------------------------------------------------
SAFE TO DELETE (2 branches)
------------------------------------------------------------
* feature/old-login
Method: merged | Reason: Merged into main
Remote: gone | Last commit: 2025-12-15
------------------------------------------------------------
LOCAL-ONLY (1 branch) - Merged but never pushed
------------------------------------------------------------
* temp/local-experiment
Method: merged | Reason: Merged but never pushed to remote
Remote: local_only | Last commit: 2025-12-10
------------------------------------------------------------
PROTECTED (2 branches)
------------------------------------------------------------
* main
Reason: Default branch
* feature/ui
Reason: Currently checked out
============================================================
SUMMARY: 2 safe | 1 local-only | 0 unmerged | 2 protected
============================================================
git-gone uses a subcommand structure powered by Cobra:
# Show general help
git-gone --help
git-gone -h
# Show version
git-gone version
# Clean branches (default command)
git-gone
git-gone branches
# Get help for specific command
git-gone branches --help
git-gone report --help
# Generate analysis report
git-gone report
# Report in JSON format
git-gone report --output json
git-gone report -o jsonNote: When using as a Git plugin (git gone), commands work the same way:
git gone- runs branch cleanupgit gone version- shows versiongit gone -h- shows help
- β/β: Navigate through the list
- Tab/Space: Toggle selection of current branch
- Enter: Confirm selection and proceed
- Esc: Cancel operation
- Type: Filter branches by name
- Never deletes the default branch (main/master)
- Never deletes the current branch
- Shows only branches that have been merged
- Requires explicit confirmation before deletion
- Attempts safe deletion first (
git branch -d) - Falls back to force deletion only if necessary
- Go 1.19 or higher
- Git installed and configured
- Terminal with UTF-8 support (for emoji indicators)
- github.com/koki-develop/go-fzf - Fuzzy finder library
When you install git-gone, the binary is placed in your $PATH. Git automatically recognizes executables named git-<command> as git subcommands, allowing you to use it as git gone.
Releases are automatically created when you push a tag starting with v:
# Create a new tag
git tag v0.3.0 -m "Release version 0.3.0"
# Push the tag to GitHub
git push origin v0.3.0GitHub Actions will automatically:
- Build binaries for all platforms (Linux, macOS, Windows)
- Create a GitHub release with the binaries
- Generate checksums for all files
This project is licensed under the MIT License - see the LICENSE file for details.