Skip to content

Instantly share code, notes, and snippets.

@o-az
Last active July 5, 2024 07:45
Show Gist options
  • Save o-az/47dbe8cff8ec205ecd274e681387211a to your computer and use it in GitHub Desktop.
Save o-az/47dbe8cff8ec205ecd274e681387211a to your computer and use it in GitHub Desktop.
search through files in past commits with fzf (fish)
function git-fzf-log
git log --oneline --decorate --color=always | fzf --ansi --no-sort --reverse --multi --bind 'ctrl-s:toggle-sort' \
--header 'Press CTRL-S to toggle sort' \
--preview 'git show --color=always {+1}' | awk '{print $1}'
end
git-fzf-log | xargs -I % git diff %^ %
function git-fzf-log; git log --oneline --decorate --color=always \
| fzf --ansi --no-sort --reverse --multi --bind 'ctrl-s:toggle-sort' \
--header 'Press CTRL-S to toggle sort' --preview 'git show --color=always {+1}' \
| awk '{print $1}'; end; git-fzf-log | xargs -I % git diff %^ %
@o-az
Copy link
Author

o-az commented Jul 5, 2024

copy pasting one_line.fish directly works - no need for custom fish function if you don't want to

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