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
# 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 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
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 --helpNote: 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.