Skip to content

Instantly share code, notes, and snippets.

Last active February 23, 2020 16:04
What would you like to do?
Git - Benefits of Flat Commit History

Flawed Commit Strategy

Developers often want to condense their git log output. However without a proper git commit strategy (and conventions), those condensed outputs are still flawed.

For details on condensed git log outputs, see Improve your Git Log Output

Consider a git lg output for a typical project:


This output shows branch merges and activity/commits on other branches. This pollutes the log output and also prevents auto-generation of ChangeLogs.

Production Commit Strategy

What is desired is something like this:


Here ^ our commit history in master is flat, linear, and easily scanned.

Notice the use of commit message conventions (eg fix(core): align breakpoints...). See Angular Git Commit Conventions for details and requirements.

ChangeLog Generation (from Commits)

With a flat commit history and consistent commit conventions, changelogs can be easily generated using Gulp Conventional Changelog Tools.

Consider the ChangeLog generated for the above ^ condensed output:


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment