Search code examples
gitmercurialdiffvisual-diff

is there a way to pipe the git or Mercurial diff output to a GUI Diff tool?


the diff result in text might be hard to get used to at first. Is there a way to pipe that output to a visual diff tool, such as something like

$ hg diff --visual code.rb

or

$ hg diff code.rb | sometool

so that the result can be viewed visually?


Solution

  • git has a "difftool" subcommand that can be used to invoke an external diff viewer, e.g. kdiff3.

    This is separate to the "external diff driver" than can be used for example if you prefer context diffs, as some people do.