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?
相关问题
- Why does recursive submodule update from github fa
- Extended message for commit via Visual Studio Code
- Emacs shell: save commit message
- Can I organize Git submodules in a flat hierarchy?
- Upload file > 25 MB on Github
相关文章
- 请教Git如何克隆本地库?
- GitHub:Enterprise post-receive hook
- Git Clone Fails: Server Certificate Verification F
- SSIS solution on GIT?
- Is there a version control system abstraction for
- ssh: Could not resolve hostname git: Name or servi
- Cannot commit changes with gitextensions
- git: retry if http request failed
If you happen to already have a diff tool associated with filetypes (say, because you installed TortoiseSVN which comes with a diff viewer) you could just pipe the regular
git diff
output to a "temp" file, then just open that file directly without needing to know anything about the viewer:Setting it as a global alias works even better:
git what
You may want to try out xd http://github.com/jiqingtang/xd, which is GUI wrapper for GIT/SVN diff. It is NOT a diff tool itself. You run
xd
when you want to rungit diff
orsvn diff
and it will show you a list of files, a preview window and you can launch any diff tool you like, including tkdiff, xxdiff, gvimdiff, emacs(ediff), xemacs(ediff), meld, diffuse, kompare and kdiff3. You can also run any custom tool.Unfortunately the tool doesn't support Windows.
Disclosure: I am the author of this tool.
With new git difftool, its as simple as adding this to your .gitconfig file:
Also check out diffall, a simple script I wrote to extend the annoying (IMO) default diff behaviour of opening each in serial.
For a linux version of how to configure a diff tool on git versions prior to 1.6.3 (1.6.3 added difftool to git) this is a great concise tutorial,
in brief:
Step 1: add this to your .gitconfig
Step 2: create a file named git_diff_wrapper, put it somewhere in your $PATH
On Mac OS X,
does the job for me in the git folder. For installing diffuse, one can use port -
I tried the fancy stuff here (with tkdiff) and nothing worked for me. So I wrote the following script, tkgitdiff. It does what I need it to do.