Skip to content

Instantly share code, notes, and snippets.

@leon
Created August 17, 2022 12:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leon/b47ee41d69c603036bdb5c12d364ccb2 to your computer and use it in GitHub Desktop.
Save leon/b47ee41d69c603036bdb5c12d364ccb2 to your computer and use it in GitHub Desktop.
GitTower VSCode as diff and merge tool - Juli 2022 Edition

VSCode July 2022 edition supports merging!

but GitTower does not yet have VS Code as an option for diff and merge tools. but they allow adding your own by creating a .plist file.

https://www.git-tower.com/help/guides/integration/custom-diff-tools/mac

Copy over the CompareTools.plist and vscode.sh files into this folder, you may need to create it

~/Library/Application Support/com.fournova.Tower3/CompareTools/

you may need to make the vscode.sh file executable by running

chmod +x ~/Library/Application Support/com.fournova.Tower3/CompareTools/vscode.sh

Restart Git Tower

From the settings choose Visual Studio Code as the diff and merge tools.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<dict>
<key>ApplicationIdentifier</key>
<string>com.microsoft.VSCode</string>
<key>ApplicationName</key>
<string>Visual Studio Code</string>
<key>DisplayName</key>
<string>Visual Studio Code</string>
<key>LaunchScript</key>
<string>vscode.sh</string>
<key>Identifier</key>
<string>code</string>
<key>SupportsMergeTool</key>
<true/>
<key>SupportsDiffChangeset</key>
<true/>
</dict>
</array>
</plist>
#!/bin/sh
if [ "$3" ]; then
# Invoke merge since param $BASE and $MERGED where passed
/usr/local/bin/code --wait --merge "$1" "$2" "$3" "$4"
else
# Invoke diff
/usr/local/bin/code --wait "$1" "$2"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment