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'p4merge "$LOCAL" "$REMOTE"'
git config --global difftool.p4merge.cmd
git config --global merge.tool p4merge'p4merge "$BASE" "$LOCAL" "$REMOTE" "$MERGED"'
git config --global mergetool.p4merge.cmd
使用
bash
git difftool
git mergetool
macOS
bash
brew install --cask p4v
git config --global merge.tool p4merge