{"id":"019d2554-7495-7de6-89b9-f94e3d478e46","title":"diffnav: a git diff pager that highlights syntax","slug":"2026/03/diffnav-a-git-diff-pager-that-highlights-syntax","renderedHtml":"<p>Git, the version control software, has <a href=\"https://www.man7.org/linux//man-pages/man1/git-diff.1.html\"><code>git diff</code></a> built-in to show you what's changed in your code - what lines were added, removed, or modified, across which files, and between which commits or branches. If you work with git, you may have used it. Maybe you've used it once and trid to forget it, because it works, but has a ... challenging user experience. It's visually noisy, monochrome, hard to scan, and in a large changeset you're paging through a wall of <code>+</code> and <code>-</code> hoping to find the file you care about.</p>\n<p><a href=\"/factoids/git delta\">git-delta</a> fixes the first part. Syntax highlighting, line numbers, improved structure - <code>delta</code> transforms git diff output into something you can actually read. If you're not using it, you should be. It's the <code>git</code> equivalent of <a href=\"https://github.com/sharkdp/bat\"><code>bat</code></a>.</p>\n<p><a href=\"https://github.com/dlvhdr/diffnav\" title=\"a git diff pager based on delta, a syntax-highlighting pager for git, diff, and grep, but with a file tree, a la GitHub.\">diffnav</a>, by Dolev Hadar, takes the next step: it wraps delta with a file tree sidebar, giving you GitHub-style navigation in your terminal. You can now jump between changed files without losing your place, collapse directories, see diff stats at a glance, and toggle between side-by-side and unified views. Keyboard-driven, mouse-supported, and as simple as piping your diff through it:</p>\n<pre><code class=\"language-sh\">git diff | diffnav\ngh pr diff https://github.com/some/repo/pull/123 | diffnav\n</code></pre>\n<p>Or set it as your default pager and forget about it:</p>\n<pre><code class=\"language-sh\">git config --global pager.diff diffnav\n</code></pre>\n<p>Very interesting tool to check out. It's also nicely done as a project; the <a href=\"https://github.com/dlvhdr/diffnav\" title=\"a git diff pager based on delta, a syntax-highlighting pager for git, diff, and grep, but with a file tree, a la GitHub.\">github</a> page for it has all the information you'd want from a project like this to give you an idea of if it'd be suitable for you or not.</p>","excerpt":"diffnav gives git a syntax-highlighted display of changes in a navigable filetree, as a natural extension of git-delta. Very nicely done and potentially very useful if you're using git from the command line.","authorId":"019c5c8a-609d-7cd4-975b-50bbcc412a33","authorDisplayName":"dreamreal","status":"APPROVED","publishedAt":"2026-03-25T14:25:39.641Z","sortOrder":0,"createdAt":"2026-03-25T14:09:45.108756Z","updatedAt":"2026-03-25T14:25:39.699437Z","commentCount":0,"tags":["git","tools"],"categories":[],"markdownSource":null}