Skip to content
Tech News
← Back to articles

Improved Git Diffs with Delta, Fzf and a Little Shell Scripting

read original get Delta Git Diff Tool → more articles
Why This Matters

This article highlights how integrating Delta, fzf, and shell scripting can significantly enhance the Git diff experience, making code reviews and version comparisons more efficient and visually appealing. Such improvements benefit developers by streamlining workflows and improving code comprehension, ultimately accelerating development cycles and reducing errors.

Key Takeaways

Awesome Git Diffs with Delta, fzf and a Little Shell Scripting

Spotting differences in code is an important part of what we do, Delta is by far the best CLI diff tool I ever used.

Want to watch the video to see how it works? It’s on YouTube.

Around a year before writing this post I tricked out git to show its diffs with delta and created a little gd (git diff) script to make it easier to see diffs when doing PR reviews. It’s all up in my dotfiles.

Then I forgot to write a blog post about it because I guess internally I thought to myself “of course I wrote a post about this already, I use this almost every day”. Oops!

This is one of those posts where it’ll be easier for the both of us to watch the demo video to see how it works. My dotfiles have all of the code. If you already know you want it without watching that’s cool too, here’s some of the files of interest in text form.

# System Dependencies

If you plan to use delta, you’ll need to install it.

If you’re using my dotfiles it automatically handles installing everything for you on Arch Linux, Debian, Ubuntu and macOS. If not, you can find delta using whatever package manager is available on your OS. It’s the git-delta package in most.

If you want to use the gd script you’ll need to have fzf installed. Again, my dotfiles take care of installing this for you too. I can’t believe it’s been 10 years since I started using fzf. It’s a gift that keeps on giving.

... continue reading