zjffun blog

Git p4merge

更新于 写于

Windows 下配置

先确保 p4merge 的路径(默认:C:\Program Files\Perforce\)在环境变量中

C:\Users\zjffu>where p4merge
  C:\Program Files\Perforce\p4merge.exe
C:\Users\zjffu>path
  ...;C:\Program Files\Perforce\;...

然后

bash
git config --global diff.tool p4merge
git config --global difftool.p4merge.cmd 'p4merge "$LOCAL" "$REMOTE"'

git config --global merge.tool p4merge
git config --global mergetool.p4merge.cmd 'p4merge "$BASE" "$LOCAL" "$REMOTE" "$MERGED"'

使用

bash
git difftool
git mergetool

macOS

bash
brew install --cask p4v
git config --global merge.tool p4merge

See: p4merge for conflict-resolution on macOS