Skip to content

Is there a way to "git -c diff.external=delta"? #1975

Answered by dandavison
byron-hawkins asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @byron-hawkins, delta displays diffs; it doesn't compute diffs itself. To use delta, you feed it the output of git diff. The normal way to do that is to add delta configuration to gitconfig: https://dandavison.github.io/delta/get-started.html and then you simply use your normal git command:

git diff --merge-base feature/improvement --  src/ui/widget.cpp

alternatively, or to quickly try out delta without messing with git config, you can just pipe git's output to delta:

git diff --merge-base feature/improvement --  src/ui/widget.cpp | delta

delta can display diff output from any program that produces unified diff (diff -u) or git diff format. But it's most commonly used with git.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by byron-hawkins
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants