Created
April 16, 2026 19:52
-
-
Save antlis/a956b3321602d5bc7ad3cdb54aa0c198 to your computer and use it in GitHub Desktop.
A small shell utility for interactively switching between Git worktrees using fzf. It displays available worktrees, allows fuzzy selection, and checks out the corresponding branch instantly. Ideal for workflows that rely heavily on git worktree.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| wtf() { | |
| local selected | |
| selected=$(wt list | fzf --ansi --header "Select worktree" --header-lines=1) | |
| if [[ -n "$selected" ]]; then | |
| local branch | |
| branch=$(echo "$selected" | awk '{print $2}') | |
| wt switch "$branch" | |
| fi | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment