Open szgergo opened 3 years ago
I second this
In macOS, the open command can be used to open applications, but may not always work as expected, especially when command line arguments are involved. In addition, the open command is usually used to open files rather than passing arguments to the application. So, if we installed meld from Homebrew, we can just use the full path of meld to configure it and it will work fine. Maybe @yousseb should mention this on that page to avoid a lot of newbies running into similar problems!
[diff]
tool = meld
[difftool]
prompt = false
[difftool "meld"]
#trustExitCode = true
#cmd = open -W -a Meld --args \"$LOCAL\" \"$REMOTE\"
cmd = /opt/homebrew/bin/meld \"$LOCAL\" \"$REMOTE\"
[merge]
tool = meld
[mergetool]
prompt = false
[mergetool "meld"]
#trustExitCode = true
#cmd = open -W -a Meld --args --auto-merge \"$LOCAL\" \"$BASE\" \"$REMOTE\" --output=\"$MERGED\"
cmd = /opt/homebrew/bin/meld --auto-merge \"$LOCAL\" \"$BASE\" \"$REMOTE\" --output=\"$MERGED\"
On the website: https://yousseb.github.io/meld/ we have this .gitconfig example:
But this will lead to "Can' open files" error once hit the git merge tool. You need to add
$PWD/
in front of all LOCAL,BASE,REMOTE and MERGED variables.This one works: