Sublime Merge Tips - Editing Git Commits

March 24, 2021 by Dylan Johnston All Posts

Here at Sublime HQ we use Sublime Merge every day to manage our Git repositories. As a result we've built lots of features to speed up our development.

In this post we'll share some of the ways we've made it easy to edit and adjust commits.

Editing a commit message

We all do it.

After meticulously crafting a series of commits, you look back and notice a typo in a commit message.

If you're lucky, it's the most recent commit and you can just amend the latest commit. If not, you'll often be tempted to just switch off your computer and call it a day.

With Sublime Merge, editing commit messages is simple:

  1. Right click the commit you want to edit in the commit graph
  2. Select Edit Commit ▶ Edit Commit Message
  3. Type in the new commit message
  4. Once you're happy with the changes, press Save
    Shortcut: Ctrl/Cmd+Enter

Editing a Commit Message


Dropping a commit

Sometimes you'll make a commit, only to realise you didn't need it. You can easily drop a commit from a branch in Sublime Merge.

  1. Select the commit(s) you want to drop in the commit graph
    Select multiple commits with Ctrl/Cmd+Left Mouse
  2. Right click one of the selected commits
  3. Select Edit Commit ▶ Drop Selected Commits
Note: you may run into a merge conflict if the edit interferes with more recent commits. In this case you will have to manually resolve the conflicts and select Continue Rebase

Dropping Commits

Squashing multiple commits together

It's common to make a series of commits, only to realise they'd be better off combined as a single commit. Using the squash functionality, you can easily combine multiple commits together.

  1. Select the commits to squash together in the commit graph
    Select multiple commits with Ctrl/Cmd+Left Mouse
  2. Right click one of the selected commits
  3. Select Edit Commit ▶ Squash Selected Commits

Note: This operation will combine all the selected commits, and replace them with an entirely new commit. A force push may be required.

Squashing Commits

Get Started with Sublime Merge

Sublime Merge is a graphical Git client from the creators of Sublime Text that makes using Git a breeze.
Want to get started? Visit the download page.