LoginSignup
4
5

More than 5 years have passed since last update.

【メモ】【OSX】peco/fzf でブランチ切替

Last updated at Posted at 2016-04-06
git branch -a \
  | perl -ne'm|[^/\* ]+$|;next if$_{$&};$_{$&}=1;next if m,^\*|remotes/.+/HEAD,;$s="\e[0m<S>";s|.*/([^/]+)/|\e[31m$1$s|; s|^ +([^/]+)$|\e[34mlocal$s$1|;print' \
  | column -ts'<S>' \
  | fzf --ansi \
  | xargs git checkout
4
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
5