git diffとしてOpendiffまたはPerforce P 4 Mergeを設定する超簡単な方法


が設定する超簡単な方法ですgit 使うopendiff or p4merge diffツールとして
git config --global alias.diffy 'difftool -t opendiff -y'
git config --global alias.diffp 'difftool -t p4merge -y'
私たちがそれをした後に、将来的に、我々は使用できます
git diffy    # to use opendiff
git diffp    # to use p4merge
代わりに、bashやzshのエイリアスを使用できます.
alias gitd='git difftool -t opendiff -y'
alias gitd2='git difftool -t p4merge -y'
diffツールの使用方法を確認するには、次の手順に従います.
git difftool --tool-help
詳細
設置する方法があるgit diff Xcodeのfilemergeを使うopendiff , またはPerforceのp4merge . 通常、このメソッドは外部シェルスクリプトを設定し、diff.external スクリプトを使用する.
コマンドgit difftool , 外部スクリプトを必要とせずに簡単にタスクを実行できます.余分な利点は、我々は使用することができますopendiff or p4merge 変更なしでdiff.external使用するときに注意してくださいp4merge , 私たちのパスに追加する必要があります/Applications/p4merge.app/Contents/MacOS Macで