Pages

Friday, September 22, 2023

BBEdit as your git diff tool on macOS

On Windows, I have two tools that get a lot of work when I'm ready to check in files:

  1. Merge tool: KDiff3 -- since 2012, it appears.
  2. Diff tool: WinMerge -- more recently; used to use KDiff3 for both

The WinMerge usage is recent-ish. When you want to compare two files and two files only, its simplistic UI is refreshing compared to the busyness of KDiff3.

One problem: KDiff3 uses KDE and is available pretty much everywhere. WinMerge is, um, Windows specific.

When I'm on macOS, I've been using BBEdit (nee TextWrangler) in place of WinMerge more recently and, I've found, you can use BBEdit as your official diff tool in SourceTree now too with a dedicated dropdown option.

One problem: SourceTree puts the more recent file on the left in BBEdit for some reason. That's not how SourceTree does it with WinMerge.

How do I swap that? Funny you should ask... Just ran into this SourceTree help request today that happens to show exactly how...

I spoke to BBEdit about this and they reminded me of the solution I had (with their help) implemented previously, before SourceTree added BBEdit to the official part of the external diff menu. I pass it along here, in case it is helpful:

in the "Diff Command" field, it needs the full path to bbdiff, e.g.

/usr/local/bin/bbdiff

I had been just putting "bbdiff" and that may have been the full problem I was having. In the "Arguments" field I put "--ignore-spaces --wait $REMOTE $LOCAL" and that seems to work well.

That still puts the newer edit on the left, but that's easy to fix. Swap $REMOTE and $LOCAL and...

Success. That's a nice, usable working environment I've almost got on macOS. 😉