Meld is a great tool to see the diff and merge two files, you can use meld as a default difftool and merge tool in all the Operating systems like windows, linux and Mac. Here, we will talk about only Mac. You can follow the below steps to set up meld as a difftool and merge tool in your Mac.
Step 1: Download and install Meld on your mac.
brew install meld
Step2: Set meld as your git difftool/mergetool by editing your ~/.gitconfigÂ
and adding the following lines.
[diff] tool = meld [difftool "meld"] trustExitCode = true cmd = open -W -a Meld --args \"$LOCAL\" \"$PWD/$REMOTE\" [merge] tool = meld [mergetool "meld"] trustExitCode = true cmd = open -W -a Meld --args --auto-merge \"$PWD/$LOCAL\" \"$PWD/$BASE\" \"$PWD/$REMOTE\" --output=\"$PWD/$MERGED\"
Now you are good. Git will use meld as difftool and merge tool. Run git difftool
command in a terminal, you will see git will open by default. Let us know if you want to know more about it.
Happy Coding!
Leave a Reply