by shigemk2

当面は技術的なことしか書かない

Git 2.23に向けたFuzzy-find and checkout a branch

git switchでリモートブランチから新しくブランチを切り直せるので、これでよいのだが、名前がもはやcheckoutじゃねえ

あと、当然といえば当然だが、bashのほうがいろいろ充実してる

function fco -d "Fuzzy-find and checkout a branch"
  git branch --all | grep -v HEAD | string trim | fzf | read -l result; and git switch (echo "$result" | sed "s/.* //" | sed "s#remotes/[^/]*/##")
end

Examples (fish) · junegunn/fzf Wiki · GitHub