Skip to content

Instantly share code, notes, and snippets.

@RyanGreenup
Created February 19, 2021 02:57
Show Gist options
  • Save RyanGreenup/02bb82102306d603c5ebd6b272e83fc4 to your computer and use it in GitHub Desktop.
Save RyanGreenup/02bb82102306d603c5ebd6b272e83fc4 to your computer and use it in GitHub Desktop.
Review Git changes using fzf
git log | grep '^commit' | sed 's/^commit\ //' |\
fzf --preview 'git diff {}^! |\
bat --color always'
@RyanGreenup
Copy link
Author

Alternatively skim allows setting keybindings:

git log | grep '^commit' | sed 's/^commit\ //'  | \
    sk --ansi \
     --bind 'ctrl-f:interactive,pgup:preview-page-up,pgdn:preview-page-down'    \
     -m -c 'bat --color always | rg -l --ignore-case' \
    --preview 'git diff {}^! | bat --color always' \

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment