Saturday, June 14, 2014

p4merge (git Merge Tool)

brew cask install p4merge

git config --global merge.tool p4mergetool
git config --global mergetool.p4mergetool.trustExitCode false
git config --global mergetool.p4mergetool.cmd "$HOME/Applications/ \$PWD/\$BASE \$PWD/\$REMOTE \$PWD/\$LOCAL \$PWD/\$MERGED"
git config --global difftool.p4mergetool.cmd "$HOME/Applications/ \$LOCAL \$REMOTE"
git config --global difftool.sourcetree.cmd "$HOME/Applications/ \$LOCAL \$REMOTE"
git config --global difftool.sourcetree.path ""
git config --global mergetool.sourcetree.cmd "$HOME/Applications/ \$PWD/\$BASE \$PWD/\$REMOTE \$PWD/\$LOCAL \$PWD/\$MERGED"
git config --global mergetool.sourcetree.trustexitcode true

To compare differences between local and remote repo

git difftool `current-git-branch-name` origin/master -Y


The "-Y" means, "Open all the p4merge diff windows without asking me each time it's okay to do so."


No comments:

Post a Comment