Skip to content

Instantly share code, notes, and snippets.

@avoidik
Last active June 30, 2024 16:18
Show Gist options
  • Save avoidik/a9b8a75dbe6ffa6b765e1567234eb6f5 to your computer and use it in GitHub Desktop.
Save avoidik/a9b8a75dbe6ffa6b765e1567234eb6f5 to your computer and use it in GitHub Desktop.
p4merge as git diff tool on macos
# install p4v tools
brew install --cask p4v

# configure git
git config --global diff.tool p4merge
git config --global difftool.p4merge.path /Applications/p4merge.app/Contents/Resources/launchp4merge
git config --global difftool.prompt false
git config --global merge.tool p4merge
git config --global mergetool.p4merge.path /Applications/p4merge.app/Contents/Resources/launchp4merge
git config --global mergetool.prompt false

# disable unwanted orig files
git config --global mergetool.keepBackup false

# test
git difftool HEAD^ HEAD
@avoidik
Copy link
Author

avoidik commented Jul 28, 2023

if you're getting checksum mismatch error similar to

Error: SHA256 mismatch
Expected: a837f5d46526603ff179630d371944cb4acfba1cada5458bf733ef3c9f7b71f6
  Actual: fba5813f43a9af3a9080611ec5bb0ad4713dc06360e005a4ee8c1d1b9e4ee4c7
    File: /Users/username/Library/Caches/Homebrew/downloads/fcbc839c1aeb569ab7b91855a69e9ee6b59f19ef0c41df253c9ce10210f09cb6--P4V.dmg
To retry an incomplete download, remove the file above.

then we have to update sha256 checksum

brew developer on
export HOMEBREW_NO_INSTALL_FROM_API=1
brew tap --force homebrew/core
brew tap --force homebrew/cask
brew edit p4v # swap sha256 checksum to actual
brew install p4v
brew developer off
brew untap homebrew/core
brew untap homebrew/cask
unset HOMEBREW_NO_INSTALL_FROM_API

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment