DoltHub Blog
Read post

Introducing `dolt_squash_history()`

Dolt, the version-controlled database, introduces `dolt_squash_history()`, a new SQL procedure that collapses an entire branch's commit history into a single commit in constant time. Unlike `dolt_rebase()` which replays every commit, `dolt_squash_history()` uses a pointer trick internally — writing one new commit with HEAD's data and reparenting it onto the initial commit — making it dramatically faster. A demo shows squashing 100 commits dropping from 1.6s (rebase) to 0.15s, and after running `dolt gc --full`, disk usage shrank from 8.5MB to 172KB (50x reduction). The procedure supports partial squashing via `--first`, requires a clean working set and a commit message, and rewrites history so remotes should be used as archives before squashing.

    #backend#git#version-control
Jul 31•8m read time•From dolthub.com
Post cover image
Table of contents
Why Squash History? #How to Squash History in Git #dolt_squash_history() #Conclusion #
48.3K Impressions
DoltHub Blog's image
DoltHub Blog

10 Followers

•

190 Upvotes

Would you recommend this post?

Copy link
WhatsApp
Facebook
X
New Squad
  • © 2026 Daily Dev Ltd.
  • Guidelines
  • Explore
  • Tags
  • Sources
  • Squads
  • Leaderboard