开发者

Can I generate a "merge tool viewable" diff output with git?

For small chunks of code, I can m开发者_如何学运维anage writing:

git diff SOURCE_FILE

but when it gets past a number of lines, it gets difficult to watch. Is there someway of generating two files, one being the staged one, the other containing the modifications, and compare them using a tool like WinMerge?


You can configure an extern diff command using the environment variable GIT_EXTERNAL_DIFF. The command get calles with the arguments newfile oldfile ... e.g.

 $ GIT_EXTERNAL_DIFF=echo git diff
 a.txt /tmp/QLpGlH_a.txt bd304d959129af4d8b920f1562e09ead75aab379 100755 a.txt 0000000000000000000000000000000000000000 100755 

Use git diff --help for details


Another possibility is to set up the external diff tool and use that with git difftool instead of calling git diff (see section CONFIG VARIABLES in the manpage for git difftool).

To see the configuration for using Araxis Merge as diff tool, see the Araxis support pages. The settings made there should be easily adoptable for the tool you're going to use.


You can use the Pretty Diff API and simply input a URI for each code location.

http://prettydiff.com/api.php

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜