Created
April 3, 2020 15:23
-
-
Save dgowrie/887a5a0b3e58f8c2f65f497d36643d9f to your computer and use it in GitHub Desktop.
git fuzzy find branch
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
fbr () { | |
local branches branch | |
branches=$(git branch --all --sort=-committerdate | grep -v HEAD) && branch=$(echo "$branches" | | |
fzf-tmux -d $(( 2 + $(wc -l <<< "$branches") )) +m) && git checkout $(echo "$branch" | sed "s/.* //" | sed "s#remotes/[^/]*/##") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
basically lists all recent branches, like yours, but including remotes. You can fuzzy-find through the branches, and when you select one it checks it out