wada811 / blog

wada811's blog
https://github.com/wada811/blog/issues
Apache License 2.0
6 stars 0 forks source link

peco で Git のブランチを選択する #15

Open wada811 opened 5 years ago

wada811 commented 5 years ago

Why

Git のブランチを絞り込んで選択したい。

What

zsh のグローバルエイリアスで BpecoGit のブランチを選択する関数を設定する。

How

設定

function peco-git-branch(){
    git branch | peco | sed -e "s/^\*[ ]*//g"
}
alias -g B='$(peco-git-branch)'

使い方

git checkout Bgit merge B など。

Ref