How do I view 'git diff' output with my preferred diff tool/ viewer?

后端 未结 26 2236
清酒与你
清酒与你 2020-11-22 03:20

When I type git diff, I want to view the output with my visual diff tool of choice (SourceGear \"diffmerge\" on Windows). How do I configure git to do this?

26条回答
  •  无人共我
    2020-11-22 03:58

    I have one addition to this. I like to regularly use a diff app that isn't supported as one of the default tools (e.g. kaleidoscope), via

    git difftool -t
    

    I also like to have the default diff just be the regular command line, so setting the GIT_EXTERNAL_DIFF variable isn't an option.

    You can use an arbitrary diff app as a one-off with this command:

    git difftool --extcmd=/usr/bin/ksdiff
    

    It just passes the 2 files to the command you specify, so you probably don't need a wrapper either.

提交回复
热议问题