Using Git efficiently: SmartGit + BeyondCompare

  Subscribe
10/17/2019 - Marco von Ballmoos (updated on 10/24/2019)

I've written about using SmartGit (SG) before1 2 and I still strongly recommend that developers who manage projects use a UI for Git.

If you're just developing a single issue at a time and can branch, commit changes and make pull requests with your IDE tools, then more power to you. For this kind of limited workflow, you can get away with a limited tool-set without too big of a safety or efficiency penalty.

However, if you need an overview or need to more management, then you're going to sacrifice efficiency and possibly correctness if you use only the command line or IDE tools.

I tend to manage Git repositories, which means I'm in charge of pruning merged or obsolete branches and making sure that everything is merged. A well-rendered log view and overview of branches is indispensable for this kind of work.

SmartGit

I have been and continue to be a proponent of SmartGit for all Git-related work. It not only has a powerful and intuitive UI, it also supports pull requests, including code comments that integrate with BitBucket, GitLab and GitHub, among others.

It has a wonderful log view that I now regularly use as my standard view. It's fast and accurate (I almost never have to refresh explicitly to see changes) and I have a quick overview of the workspace, the index and recent commits. I can search for files and easily get individual logs and blame.

The file-differ has gotten a lot better and has almost achieved parity with my favorite diffing/merging tool Beyond Compare. Almost, but not quite. The difference is still significant enough to justify Beyond Compare's purchase price of $60.

What's better in Beyond Compare3?

Diffing

  • While both differs have syntax-highlighting (and the supported file-types seem to be about the same), Beyond Compare distinguishes between significant and insignificant (e.g. comments) changes. It makes it much easier to see whether code or documentation has changed.
  • The intra-line diffing in Beyond Compare is more fine-grained and tends to highlight changes better. SmartGit is catching up in this regard.
  • You can re-align a diff manually using F7. This is helpful if you moved code and want to compare two chunks that the standard diff no longer sees as being comparable

Merging

I could live without the Beyond Compare differ, but not without the merger.

  • The 4-pane view shows left, base and right above as well as the target below, with the target window being editable. Each change has its own color, so you can see afterwards whether you took left, right or made manual changes.
  • The merge view includes a line-by-line differ that shows left, base, right and target lines directly above one another, with a scrollbar for longer lines.
  • The target view is color-coded to show the origin of each line of text: right, left, base or custom edited.
  • BeyondCompare makes a smart recommendation for how to merge a given conflict that is very often exactly what you want, which means that for many conflicts, you can just confirm the recommendation.
  • SmartGit has two separate windows for base vs. left/right and right/left vs. target. Long lines are really hard to decipher/merge in SmartGit

Integrate Beyond Compare into SmartGit

To set up SmartGit to use Beyond Compare

  1. Select Tools > Diff Tools
  2. Click the "Add..." button
  3. Set File Pattern to *
  4. Select "External diff tool"
  5. Set the command to C:\Program Files (x86)\Beyond Compare 4\BCompare.exe
  6. Set the arguments to "${leftFile}" "${rightFile}"
  7. Select Tools > Conflict Solvers
  8. Select "External Conflict Solver"
  9. Set File Pattern to *
  10. Set the command to C:\Program Files (x86)\Beyond Compare 4\BCompare.exe
  11. Set the arguments to "${leftFile}" "${rightFile}" "${baseFile}" "${mergedFile}"


  1. In Git: Managing local commits and branches (December 2016) and Programming in the modern/current age (February 2013)

  2. I am in no way affiliated with SmartGit.

  3. I am in no way affiliated with BeyondCompare.

Sign up for our Newsletter