LoginSignup
23
23

More than 5 years have passed since last update.

peco で git のコミットハッシュを選択する alias

Posted at

いちいち git log からコミットハッシュを探しだすのが面倒なので、alias を定義してみました。

alias -g C='`git log --oneline | peco | cut -d" " -f1`'

例えば、git show C では peco で選択したコミットの中身をみることができます。
git reset --hard C では選択したコミットまでロールバックできます。

また、reflog から選択する alias も定義しました。

alias -g R='`git reflog | peco | cut -d" " -f1`'

git reset --hard R では peco で選択した時点まで操作履歴をロールバックできます。

See also: dot.zsh/.zshrc.peco - dtan4/dot.zsh

23
23
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
23
23