git cant resolve rebase conflicts as mergetool doesnt pop up

848 views Asked by At

I am performing a rebase in my current branch 'MyUseCaseTest' with the master branch.

I get merge conflicts which I attempt to resove using my configured mergetool which is vsdiffmerge. Here is the .gitconfig file

[diff]
    tool = vsdiffmerge
[difftool]
      prompt = false
[difftool "vsdiffmerge"]
      cmd = '"%VSINSTALLDIR%Common7/IDE/vsdiffmerge.exe"' "$LOCAL" "$REMOTE" //t
      keepbackup = false
      trustexitcode = true
[merge]
      tool = vsdiffmerge
[mergetool]
      prompt = false
[mergetool "vsdiffmerge"]
      cmd = '"%VSINSTALLDIR%Common7/IDE/vsdiffmerge.exe"' "$REMOTE" "$LOCAL" "$BASE" "$MERGED" //m
      keepbackup = false
      trustexitcode = true

Here are the commands I have tried to get vsdiffmerge tool to pop up,

git mergetool
git mergetool -t vsdiffmerge

but they dont and give this error instead

$ git mergetool -t vsdiffmerge
Merging:
src/OneDirection.cs
src/CustomBatch.cs

Normal merge conflict for 'src/OneDirection.cs':   
{local}: modified file   
{remote}: modified file 
/libexec/git-core/git-mergetool--lib: line 136: fg: no job control 
merge of src/OneDirection.cs failed 
Continue merging other unresolved paths (y/n) ?

I click on yes and get the same error, but for the other file. I dont know what is wrong and how to fix it. The manuals don't explain this scenario. I couldn't find anything that explains what is going on or how to fix it.

Please help.

2

There are 2 answers

0
Matt Wanchap On

I was having a similar issue and orad's answer pointed me in the right direction - the path was the problem (I'm still not used to linux-style paths...) and what ended up working for me was this:

[diff]
    tool = vsdiffmerge
[difftool]
  prompt = false
[difftool "vsdiffmerge"]
    cmd = \"C:/Program Files (x86)/Microsoft Visual Studio 14.0/Common7/IDE/vsdiffmerge.exe\" "$LOCAL" "$REMOTE" //t
    keepbackup = false
    trustexitcode = true
[merge]
    tool = vsdiffmerge
[mergetool]
    prompt = false
[mergetool "vsdiffmerge"]
    cmd = \"C:/Program Files (x86)/Microsoft Visual Studio 14.0/Common7/IDE/vsdiffmerge.exe\" "$REMOTE" "$LOCAL" "$BASE" "$MERGED" //m
    keepbackup = false
    trustexitcode = true

Although it'd be really nice to be able to use %VSINSTALLDIR% to avoid the absolute file paths. Thanks to Mark Kadlec for showing the right syntax.

0
AMIT PRAKASH PANDEY On

Once you get conflict, you can simply open that file and search for HEAD to see the place of conflict and resolve it manually.