Interactive git branch selector with fuzzy search, built with Go and Bubbletea TUI.
A modern replacement for fzf-based branch selection scripts, compiled as a single binary with no external dependencies.
- Interactive branch selection with fuzzy search
- Branches sorted by last commit date (most recent first)
- Live git log preview for selected branch
- Highlights current branch
- Keyboard navigation (arrow keys)
- No external dependencies (unlike fzf-based solutions)
- Single static binary
Install via NPM with Bun (automatically downloads the correct binary for your platform):
# Using bun (recommended)
bun install -g branch-select
# Or with npm
npm install -g branch-select
# Or with yarn
yarn global add branch-selectSupported platforms:
- macOS (Intel and Apple Silicon)
- Linux (x64 and ARM64)
Download the latest release from the releases page, or build from source:
go build -ldflags="-s -w" -o branch-selectFor smaller binary size:
# Install upx (optional)
# brew install upx # macOS
# apt-get install upx # Linux
go build -ldflags="-s -w" -o branch-select
upx --best --lzma branch-select# Copy to a directory in your PATH
cp branch-select ~/.local/bin/
# Or use go install
go install github.com/bhacaz/branch-select@latestAdd to your ~/.gitconfig:
[alias]
bs = !branch-selectRun directly:
./branch-selectOr use the git alias:
git bs↑/↓- Navigate branchesEnter- Checkout selected branchEscorCtrl+C- Cancel and exit- Type any letter to search/filter branches (fuzzy search)
Backspace- Delete search character
The application:
- Fetches all local git branches sorted by commit date
- Displays them in an interactive TUI with fuzzy search
- Shows a live preview of git log for the selected branch
- Checks out the selected branch when you press Enter
- Requires fzf to be installed separately
- Shell script with external dependencies
- Works great but needs fzf in PATH
- Single binary, no dependencies
- Native TUI with Bubbletea
- More portable across systems
- Can be distributed as a single file
- Git (must be in PATH)
- Must be run from within a git repository
This project uses mise to manage tool versions. Install mise first:
# Install mise
curl https://mise.run | sh
# Or with homebrew
brew install mise# Clone repository
git clone https://github.com/bhacaz/branch-select.git
cd branch-select
# Install tools (Go and Bun) via mise
mise install
# Install dependencies
go mod download
# Run
go run main.go
# Build
go build -o branch-select
# Or use make
make build# Pack the package
bun pack
# Install globally from local tarball
bun install -g ./branch-select-1.0.0.tgz
# Test
branch-selectMIT License