Interactive git branch selector in the terminal.
- Highlight the currently active branch in green.
- Navigate with arrows or j/k keys.
- Press Enter to switch the selected branch.
- Press q to quit.
make
sudo make install
This installs the git-select binary to /usr/local/bin/.
Run in any git repository:
git select
The program will:
- Display a prompt and the branch table (
git branch -voutput). - Highlight the currently active branch.
- Allow navigation with arrows or
j/k. - Checkout the selected branch with Enter.
- Quit with
q.
Here is an example of how git select looks for terminal:
$ git select
Select git branch (↑/↓ j/k, Enter to switch, q to quit)
1-initial-setup a1b2c3d initialize project structure
2-api-refactor b2c3d4e refactor request handling
3-ui-polish c3d4e5f adjust spacing and colors
experiment-fast-build d4e5f6a test alternative build flags
➜ main e5f6a7b merge feature branches
release-2025-01 f6a7b8c prepare release artifacts
spike-performance a7b8c9d measure cold start latency
➜marks the currently selected branch (highlighted).mainis the active branch (green).- Navigate with arrows or j/k, press Enter to switch, q to quit.
- Lines are truncated to terminal width to prevent wrapping issues.
If you want even faster access, you can add an alias in your shell configuration (~/.bashrc, ~/.zshrc, etc.):
# shorter alias for git select
alias br='git select'
Reload your shell:
source ~/.bashrc # or ~/.zshrc
Then you can run:
br
- Standard C++ compiler (
g++) - POSIX-compatible terminal (Linux, macOS)
No external libraries required.