LinuxCommandLibrary

git-delta

Highlight changes in git diff and show

TLDR

List files from the current checked out branch that differ from the main branch

$ git delta [main]
copy

List files from a specific branch that differ from another specific branch
$ git delta [branch_1] [branch_2]
copy

SYNOPSIS

delta [options] [input_file]

PARAMETERS

--list-languages
    List supported languages for syntax highlighting.

--list-themes
    List available themes for syntax highlighting.

--show-config
    Display the active delta configuration.

--config file
    Specify a custom configuration file.

--side-by-side
    Display diffs in side-by-side mode.

--width number
    Set the width of the output (only used for side-by-side mode).

--line-numbers
    Show line numbers.

--no-gitconfig
    Ignore Git configuration.

--version
    Show the version number and exit.

--help
    Show help message and exit.

DESCRIPTION

git-delta is a syntax-highlighting pager for git, diff, and grep output. It aims to make diffs easier and more beautiful to read. It allows you to view colorized, side-by-side or unified diff output in your terminal. Delta uses advanced syntax highlighting with support for a wide range of languages and customizable themes.

Unlike standard diff or git diff, delta displays the changes in a more visually appealing and understandable way, highlighting both line differences and intra-line changes (like words or characters changed within a line).

It's highly configurable allowing users to define colors, styles, and layout to match personal preferences. It integrates seamlessly with git, becoming the default pager for diff output when configured.

CAVEATS

delta relies on syntax highlighting libraries. If these libraries are not properly configured, some languages may not be highlighted correctly. Also, performance might vary based on the size of the diff and the complexity of the syntax highlighting rules.

CONFIGURATION

delta can be configured through command-line arguments or a dedicated configuration file. The configuration file is typically located at ~/.config/delta/config. Options in the configuration file override default settings, providing granular control over the tool's behavior, including colors, styles, and display modes.

HISTORY

delta is a relatively recent command-line tool designed to enhance the git diff experience. It was created to address the limitations of the default git diff output, providing better readability and customization through syntax highlighting. It gained popularity due to its ease of use and integration with existing git workflows.

SEE ALSO

git(1), diff(1), less(1)

Copied to clipboard