Skip to content

Instantly share code, notes, and snippets.

@zolotyh
Created September 26, 2019 02:14
Show Gist options
  • Select an option

  • Save zolotyh/01c73dbf65bb373ac53797eaf62f89cf to your computer and use it in GitHub Desktop.

Select an option

Save zolotyh/01c73dbf65bb373ac53797eaf62f89cf to your computer and use it in GitHub Desktop.
fbr() {
local branches branch
branches=$(git branch --all | 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