Is it possible to configure git diff to use emacs diff? If yes, can you please tell me how?
Thank you.
Go to your repository in Git Bash. Type git config diff. tool winmerge . Verify it worked by typing git difftool .
By default, git calls vimdiff with the -R option. You can override it with git config --global difftool. vimdiff. cmd 'vimdiff "$LOCAL" "$REMOTE"'.
The diff can be done with git diff (followed by the filename or nothing if you want to see the diff of all modified files). But if you already did something like git add * , you have to undo with git restore --staged .
See this question: how-do-i-view-git-diff-output-with-visual-diff-program for information on git difftool.
You can also use git from within emacs: EmacsWiki: Git.
It seems to be possible, according to the Pro Git book.
See chapter 7.1 for more information, but the quick'n'dirty of it seems to be
$ git config --global diff.external [your favorite differ here]
or, if you want it to your ~/.gitconfig
[diff]
external = [your favorite differ here]
If you are working within Emacs, you could advice vc-git-diff
(the function is found in vc-git.el for reference), to give you the option of using either git-diff or emacs-diff according to your whim (and it wouldn't require you "forking" the git library that comes bundled with Emacs).
Assuming you mean git-diff, not git-difftool, you are probably looking for the diff.external
config option. You'll want to look at the git Diffs section of git(1). This section doesn't mention the config setting, though it's listed in git-config(1).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With