This page covers external tool integration for JetBrains IDEs, Sourcetree, Tower, and Visual Studio Code.

Jetbrains

Merge

Open the configuration with ⌘, then go to Tools ▸ Diff & Merge ▸ External Diff Tools

Diff

Tools ▸ Diff & Merge ▸ External Diff Tools
Tools ▸ Diff & Merge ▸ External Diff Tools

Sourcetree

  1. Open the configuration with ⌘,.
  2. Configure merge:
  1. Configure diff:

Tower

This assumes you already installed abd.

Tower supports custom external diff/merge tools on macOS through a CompareTools.plist registration file and an executable wrapper script.

1) Create the compare tools folder and plist

Copy this whole block to your Terminal, including the trailing EOF.

mkdir -p ~/Library/Application\ Support/com.fournova.Tower3/CompareTools

cat > ~/Library/Application\ Support/com.fournova.Tower3/CompareTools/CompareTools.plist << 'EOF'
<?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>dev.jano.apple.abdiff</string>

    <key>ApplicationName</key>
    <string>ABDiff</string>

    <key>DisplayName</key>
    <string>ABDiff</string>

    <key>LaunchScript</key>
    <string>abdiff.sh</string>

    <key>Identifier</key>
    <string>abdiff</string>

    <key>SupportsMergeTool</key>
    <true/>

    <key>SupportsDiffChangeset</key>
    <true/>
  </dict>
</array>
</plist>
EOF

If CompareTools.plist already exists because you configured other custom tools, merge the <dict> entry into the existing top-level <array> instead of overwriting the file.

2) Create the launch script

Copy this whole block to your Terminal:

cat > ~/Library/Application\ Support/com.fournova.Tower3/CompareTools/abdiff.sh << 'EOF'
#!/bin/sh

ABD="$(command -v abd)"

if [ -z "$ABD" ] || [ ! -x "$ABD" ]; then
  echo "ABDiff CLI 'abd' was not found in PATH" >&2
  exit 128
fi

abs_path() {
  case "$1" in
    /*) printf '%s\n' "$1" ;;
    *) printf '%s/%s\n' "$PWD" "${1#./}" ;;
  esac
}

if [ "$#" -eq 2 ]; then
  LEFT=$(abs_path "$1")
  RIGHT=$(abs_path "$2")
  exec "$ABD" --local "$LEFT" --remote "$RIGHT"
elif [ "$#" -eq 4 ]; then
  LOCAL=$(abs_path "$1")
  REMOTE=$(abs_path "$2")
  BASE=$(abs_path "$3")
  MERGED=$(abs_path "$4")
  exec "$ABD" --base "$BASE" --local "$LOCAL" --remote "$REMOTE" --result "$MERGED"
else
  echo "Unexpected argument count: $#" >&2
  exit 1
fi
EOF

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

The opening delimiter is quoted so the shell does not expand the file contents while writing them. The closing delimiter stays unquoted because that is the form the shell expects.

3) Configure Tower

Open Tower ▸ Settings ▸ Git Config and set:

When Tower compares two commits, it may pass two temporary directories instead of two files. ABDiff accepts that invocation and opens a read-only changeset view with the changed-file sidebar. This is not a folder-comparison tree.

4) Use ABDiff for conflicts

When Tower shows a conflicted file in the working copy:

Tower will launch ABDiff for that conflict.

5) Test from Terminal

Test from Terminal in a Git repository:

git difftool --tool=tower path/to/file
git mergetool --tool=tower path/to/file
abd changeset --repo /path/to/repo --left <commitA> --right <commitB>

Tower configures Git through its own tower tool entries, so the verification commands above use --tool=tower even though the custom tool identifier inside CompareTools.plist is abdiff.

Notes

Visual Studio Code

Install the ABDiff extension for VS Code from https://github.com/janodev/vscode-abd.

If you prefer not to install another extension, you can still resolve merge conflicts using VS Code: