After switching to Mac, BeyondCompare is no longer so easy to use for free. Today, I finally found a Git GUI comparison tool P4Merge

download

To find P4Merge in Perforce-Visual-Merge-and-diff-tools, click FREE DOWNLOAD P4Merge in the upper left corner and find P4Merge in Perforce Clients: Visual Merge Tool, select Mac OS 10.6+ (64bit) in the second row on the right, click Accept and Download and select Skip Registration.

After downloading the p4V. DMG file, double-click to open it and drag P4Merge into the Application folder to complete the installation.

configuration

git config --global diff.tool p4merge
git config --global difftool.p4merge.cmd /Applications/p4merge.app/Contents/MacOS/p4merge
git config --global difftool.p4merge.cmd "/Applications/p4merge.app/Contents/Resources/launchp4merge \$LOCAL \$REMOTE"
Copy the code

Error: key does not contain a section: -global error: key does not contain a section: -global

Git difftool now prompts you with git difftool:

/usr/libexec/git-core/mergetools/p4merge: line 2: p4merge: command not found

The reason is that the path needs to be configured as follows

Git config – global difftool. P4merge. The path “/ Applications/p4merge app/Contents/Resources/launchp4merge” later want to compare the code of git, Git Difftool Filepath

Linux, Windows also can use this tool to compare code, but need to be configured separately. P4Merge provides comparison and merge functions. For details about how to configure P4Merge, refer to the following reference links. There is also a visual comparison tool meld, said to be good, have time to try.

reference

Mac OS X git Merge P4Merge

Git User Information

Setup P4Merge as a Visual diff and Merge tool for Git