使用opendiff进行git冲突文件合并
Posted on: 2017-06-02, Last modified: 2017-06-02, View: 1139

FileMerge is a utility that comes with OS X / Xcode, although it is hidden and not the easiest to get to. You can dig around the Xcode.app directory until you find it, although the command ‘opendiff’ should already exist in your terminal. To see a visual diff of two files, run ‘opendiff file1 file2’ in your terminal, and a GUI app will appear.

To set FileMerge as your git diff tool, first create a simple script that will be the translator between git and the FileMerge utility. I keep mine in the following location:

vim ~/bin/git-diff.sh

The contents of the file will look like this:

#!/bin/sh
/usr/bin/opendiff "$2" "$5" -merge "$1"

Once the script has been made, you’ll want it to be executable

chmod u+x ~/bin/git-diff.sh

Finally, tell git that you want to set it up as your default merge tool:

git config --global diff.external ~/bin/git-diff.sh

If you later decide you hate it, run this command to go back:

git config --global --unset diff.external

From: https://thomashunter.name/blog/set-opendiff-filemerge-as-your-git-diff-tool-on-os-x/
Go
Friend Links:
Bill Site
https://item.taobao.com/item.htm?spm=a21an.7676007.1998473182.296.lAvrE2&id=45399580446