git-delta
Highlight changes in git diff and show
TLDR
List files from the current checked out branch that differ from the main branch
List files from a specific branch that differ from another specific branch
SYNOPSIS
delta [OPTIONS] [FILE...]
git diff | delta [OPTIONS]
git log -p | delta [OPTIONS]
diff -u | delta [OPTIONS]
PARAMETERS
--side-by-side
Display changes side-by-side for easier comparison of modified lines.
--line-numbers
Show line numbers on the left and/or right side of the diff display.
--syntax-theme
Apply a specific syntax highlighting theme (e.g., `ansi`, `solarized-light`).
--paging
Control when delta should use a pager: `auto` (default), `always`, or `never`.
--width
Set the screen width, useful for adjusting the layout of side-by-side views.
--minus-style
Define the styling for removed lines (e.g., `red reverse`).
--plus-style
Define the styling for added lines (e.g., `green bold`).
--file-style
Define the styling for file paths displayed in the diff header.
--hunk-header-style
Define the styling for hunk headers (e.g., `bold cyan`).
--word-diff-regex
Enable word-level diffing using a custom regular expression.
--diff-highlight
Apply delta's built-in logic for highlighting modified words within lines.
--tabs
Set the display width of tab characters.
--true-color
Force 24-bit true color output, if supported by the terminal emulator.
--navigate
Enable interactive navigation between hunks using keyboard shortcuts.
--config
Specify an alternative configuration file instead of reading from `.gitconfig`.
DESCRIPTION
git-delta is a powerful command-line utility designed to enhance the readability of `git diff` output. It functions as a pager, taking standard diff input and rendering it with advanced features such as syntax highlighting, line numbers, and a choice of unified or side-by-side views. Key functionalities include intelligent word-diffing, highlighting of moved lines, improved hunk headers, and extensive customization options for colors, styles, and themes. By transforming raw diffs into a more intuitive and visually appealing format, git-delta significantly improves the experience of reviewing code changes, debugging, and understanding version control history. It aims to make diffs as clear and informative as possible, streamlining development workflows.
CAVEATS
For very large diffs, git-delta might introduce a slight performance overhead compared to plain `less`, although it is generally well-optimized. Optimal functionality and appearance often require a true-color compatible terminal emulator. Users typically need to configure `git` to use `delta` as its default pager, which involves modifying the `.gitconfig` file.
CONFIGURATION
git-delta is extensively configurable via Git's configuration system. Users commonly set `core.pager=delta` in their global or repository-specific `.gitconfig` file, or define Git aliases (e.g., `git config --global alias.d 'diff --color | delta'`) to invoke `delta` with specific options. This allows for deep personalization of diff display based on user preferences and project requirements.
HISTORY
git-delta was created by `dandavison` and first released in 2019. Developed in Rust, its primary motivation was to provide a highly customizable and aesthetically pleasing alternative to existing diff pagers, addressing limitations in readability and visual presentation. It quickly gained adoption within the Git community due to its advanced features like intelligent syntax highlighting and superior layout options.