Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Visual Studio Code as a merge tool for Git Tower.

Enable Visual Studio Code for Merge/Diff on Windows

From PowerShell or CMD:

cd C:\Program Files (x86)\fournova\Tower\CompareTools
code .

Edit VisualStudioCode.json and replace line 10 which is:

    "%ProgramW6432%\\Microsoft VS Code\\Code.exe",

With

    "C:\\Program Files\\Microsoft VS Code\\Code.exe"

Code will throw an error saving because it requires local admin permissions, use the "Retry as admin" button in the UI and the file should save. You can now open Tower and select Visual Studio code as your Diff and Merge tool.

Enable Visual Studio Code for Merge/Diff on macOS

  1. Create the required directory which doesn't exist by default. Note: this directory is the same for both Tower3 AND Tower4.
mkdir -p ~/Library/Application\ Support/com.fournova.Tower3/CompareTools/
  1. Copy CompareTools.plist, gitconfig and code.sh to ~/Library/Application Support/com.fournova.Tower3/CompareTools/
  2. Restart Git Tower
#!/bin/sh
code --wait "$4"
<?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>code.sh</string>
<key>Identifier</key>
<string>code</string>
<key>SupportsMergeTool</key>
<true/>
<key>SupportsDiffChangeset</key>
<false/>
</dict>
</array>
</plist>
[merge]
tool = vscode
[mergetool "vscode"]
cmd = code --wait "$MERGED"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.