I want to change my git mergetool kdiff3 to p4merge. because I'm getting an error on my windows system using kdiff3 mergetool.
/mingw32/libexec/git-core/git-mergetool--lib: line 128: C:\Program Files\KDiff3\kdiff3: cannot execute binary file: Exec format error application/config/constants.php seems unchanged.
So that I want to change to kdiff3 to p4merge, Here also I'm getting an error like
warning: merge.tool has multiple values error: cannot overwrite multiple values with a single value Use a regexp, --add or --replace-all to change merge.tool.
How can I solve this problem? Either kdiff3 or p4merge
It is possible your kdiff3 installation is broken since it is not working. Or maybe you tried to edit config file manually and messed its content. why? Because windows executables have .exe
extension in general. you may try editing config again.
Anyways, that is not important anymore. This is what you need to use if you want to try any other tool.
git mergetool --tool=p4merge
There are possibly others already installed with your git. You can see all of them in addition to compatible others.
git mergetool --tool-help
Edit:
This command works only if you set your path to the tool correctly. Otherwise, you always get No files need merging
result. You already know how to set the path, but I will include here for anyone else that might need.
Get the list of configuration items:
git config -l
See if you already have values set correctly, if any. then set to correct value or remove.
git config --unset mergetool.p4merge.path
git config --add mergetool.p4merge.path "c:/somewhere/p4merge.exe"
EDIT: I will offer a cleaning process so, these additional commands will help.
first steps are to make a backup of current settings. The simplest way is using these listings, then copy paste results.
git config --list
git config --global --list
then with these edit commands, just get config files' path and backup them (vim shows path) or save to a different location inside the editor.
git config --edit
git config --global --edit
now backups are ready, just exit editor. do not try to edit manually if it is not really needed.
git config --unset name
git config --global --unset name
git config --remove-section name
git config --global --remove-section name
merge.tool
, mergetool.name
, diff.tool
and difftool.name
are the ones to clean here. when you list the configs again, you should not see these names. local and global should be cleaned separately.
Then set back those we just cleaned one by one. but this time first try them on local configuration first then if successful set on global too.
git config merge.tool name
git config mergetool.name.property value
git config diff.tool name
git config difftool.name.property value
Here property
is those like cmd
and path
, and value
is their values which you can copy from your backups. Now the important thing here is to set only 1 tool
at a time at first.
One last thing about paths. You (the OP) seem to use Linux-like environment, so using /
instead of \\
would make path
and cmd
better to understand.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With