Search code examples
gitgit-diff

How can I get git to use graphical diff locally and textual diff over ssh?


I've configured git to use meld as the difftool, but I sometimes need to see textual diffs when working over SSH. Is there any way to configure git so that it uses the proper diff tool for the environment?

My current .gitconfig:

[diff]
        external = meld
        tool = meld
[merge]
        external = meld
        tool = meld
[difftool]
        prompt = false

Solution

  • Write a differ that checks the environment and invokes the right diff engine and put that in your config.