Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gvimdiff mergetool for msysgit

I'm trying to use gvimdiff as a mergetool for git on Windows. Previously I've used vimdiff in console mode, but know feel like I'm not happy with limiting view Windows console size, so I'm trying to switch to gvimdiff which have more flexible approach to setting window size.

But trying to call git mergetool now I'm receiving error which is not clear for me:

The merge tool gvimdiff is not available as 'gvim'

How this could be resolved?

gvim for Windows is install and accessible via command line. The same is true for gvimdiff command.

I'm trying to find the place where this error is raised in git scripts, but currently with no luck.

like image 775
shytikov Avatar asked Jun 14 '12 07:06

shytikov


People also ask

How do I set up Mergetool?

git mergetool is fully configurable so you can pretty much chose your favourite tool. In brief, you can set a default mergetool by setting the user config variable merge. tool . If the merge tool is one of the ones supported natively by it you just have to set mergetool.

How do I resolve merge conflicts in Mergetool?

We can manually resolve the merge conflict by editing the content in the bottom pane, and then saving the file using :wqa (Write and Quit all files). Once the conflict resolution is successful, the merged file will be staged for commit. git commit -m 'Merged from multiple branches' .


2 Answers

Combining your answers, these are my settings

.gitconfig

[alias]
    d = difftool
[diff]
    renames = copy
    tool = gvimdiff
[difftool "gvimdiff"]
    cmd = "gvim -d" "$LOCAL" "$REMOTE"
[difftool]
    prompt = false

And added file gvim accessible in %PATH% with content:

"C:\Program Files (x86)\Vim\vim73\gvim.exe" "$@"

Git difftool in Windows to see list of all changed files in addition to file diffs (a la Kaleidoscope)?

like image 45
rofrol Avatar answered Sep 21 '22 17:09

rofrol


If you start a Git console, are you sure the commands are accessible? I'm suspecting that it is not on the PATH of your Git console, only the Windows PATH (which is not entirely included).

like image 67
rlegendi Avatar answered Sep 22 '22 17:09

rlegendi