All posts

Guides1 min read

Squash a range below HEAD

Fold a commit range that sits under the branch tip; commits above it keep their messages, and staged work is left alone.

You used to squash only a range that ended at HEAD. You can now fold a stretch of commits that sits under the tip: the commits above it stay as they are (same messages, same authors), and anything you have staged is left alone.

How to squash

  1. In the commit graph, select the contiguous range you want to fold (shift-click or ⌘-click the commits). It does not have to include the tip.
  2. Right-click the selection and choose Squash N commits….
  3. Edit the combined message if you want, then confirm Squash.

GitLane replays the commits above that range so the branch tip still has them, just sitting on the new squashed commit.

If you need to undo it, git reset --hard ORIG_HEAD in a terminal (or Recover in GitLane) takes you back to the tip from before the squash.

Good to know

The range has to be a linear stretch GitLane can replay. A merge in the middle, a commit that’s already on the remote, or a selection that isn’t ancestral will be refused rather than half-applied.

You also need to be on a real branch, not detached HEAD, when the squash sits below the tip.

Shipped in GitLane v2.1.3.

Installers: Download GitLane.