Git | peco で最近使ったローカルブランチにチェックアウトする
コマンド
git reflog
から取ってみる。
$ git checkout $(git reflog | grep 'checkout: moving' | awk '{ print $8}' | awk '!a[$0]++' | peco)
画面
こんな感じ。
いちどブランチを選ぶと、次にコマンド実行した時には、最前列に繰り上がってくれる。
エイリアス登録
$ git jump
とかで起動できるようにしておくと便利かもしれない。
[alias]
jump = !git checkout $(git reflog | grep 'checkout: moving' | awk '{ print $8}' | awk '!a[$0]++' | peco)
環境
- git version 2.14.1
- peco version v0.5.1
- Mac OSX Sierra
参考
Author And Source
この問題について(Git | peco で最近使ったローカルブランチにチェックアウトする), 我々は、より多くの情報をここで見つけました https://qiita.com/YumaInaura/items/fc3afdb6ad4c78d5bcc5著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .