Git (windows); P4merge error as mergetool

I tried to configure p4merge as my mergetool, but I cannot get it to work. Here are my commands:

git config --global merge.tool p4merge git config --global mergetool.p4merge.path "C:/Program Files/Perforce/p4merge.exe" git config --global mergetool.p4merge.cmd "p4merge.exe \"$BASE\" \"$LOCAL\" \"$REMOTE\" \"$MERGED\"" 

And here is the error I get: enter image description here

I also tried installing a portable version of git and running commands from windows cmd, and I still get a similar error .

Any ideas here? I'm at a dead end.

Edit

Oddly enough, after I installed p4merge via git bash and it failed, I tried to merge in Visual Studio Team Explorer and it launched p4merge (tableflip). I believe the command that runs through VS is similar to git bash, but I'm not sure how to relate these two.

Edit 2:

Here my git status shows my merge conflict status: enter image description here

+5
source share
1 answer

First try the same configuration command as the regular cmd session (as I mentioned double quotes in escape in git config from cmd ").
Just make sure you unzip the latest git -for-windows ( PortableGit-2.8.3-64-bit.7z.exe ), for example C:\git , and add C:\git\bin to your %PATH% .

Secondly, make sure you have files that require merging, i.e. which have unresolved merge conflicts (with merging conflict markers in them), for git mergetool to work.

+1
source

All Articles