Last active
May 12, 2019 16:53
-
-
Save teopeurt/79fd7669168243ca585ff42497a6405f to your computer and use it in GitHub Desktop.
command line for p4merge usage.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# chmod +x and copy to ~/bin/p4merge | |
# then | |
# git config --global merge.tool p4merge | |
# git config --global mergetool.keepTemporaries false | |
# git config --global mergetool.prompt false | |
if [ -n "$GIT_DIR" ]; then | |
if $(git submodule | grep -q $2); then | |
tmp=$(mktemp -t $2) && trap 'rm -rf $tmp' EXIT HUP INT QUIT TERM | |
sha=$(cd $2 > /dev/null && git rev-parse HEAD) | |
echo "Subproject commit $sha" > $tmp | |
set -- $1 $tmp | |
fi | |
fi | |
for arg; do [[ $arg = /* ]] || arg=$PWD/$arg; absargs+=("$arg"); done; | |
/Applications/p4merge.app/Contents/Resources/launchp4merge "${absargs[@]}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment