Skip to content

Instantly share code, notes, and snippets.

@bestknighter
Created July 16, 2022 18:21
Show Gist options
  • Save bestknighter/2952d27e1b83753948ab5d1e71445658 to your computer and use it in GitHub Desktop.
Save bestknighter/2952d27e1b83753948ab5d1e71445658 to your computer and use it in GitHub Desktop.
Hack/Workaround to get a 3 way diff in vscode
#!/usr/bin/env sh
if [ $# -ne 4 ]; then
echo "Usage: code3diff BASE REMOTE LOCAL MERGED"
exit -1
fi
BASE=$1
REMOTE=$2
LOCAL=$3
MERGED=$4
code --diff "$BASE" "$REMOTE"
code --diff "$BASE" "$LOCAL"
code --diff "$BASE" "$MERGED"
code --diff "$REMOTE" "$LOCAL"
code --wait --diff "$LOCAL" "$MERGED"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment