Home / Companies / GitHub / Blog / Post Details
Content Deep Dive

Squash your commits

Blog post from GitHub

Post Details
Company
Date Published
Author
Fabian Perez
Word Count
354
Language
English
Hacker News Points
-
Summary

GitHub has introduced new options for managing commit history when merging pull requests, allowing repository administrators to better align with their preferred workflows. Historically, the merge button on GitHub created merge commits that retained all commits from a feature branch, resulting in a complex but detailed history. Now, the platform offers commit squashing, which consolidates work-in-progress commits into a single commit, making the history cleaner and easier to navigate. Administrators can choose to allow both merge commits and commit squashing, retain only merge commits (the previous default), or enforce commit squashing on all merges. These options provide flexibility in maintaining a project's history and cater to different preferences for repository management.