Skip to content

Instantly share code, notes, and snippets.

@ThomasBurleson
Last active February 23, 2020 16:04
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ThomasBurleson/37bdf73e7b9641a1dc9970998603f2c8 to your computer and use it in GitHub Desktop.
Save ThomasBurleson/37bdf73e7b9641a1dc9970998603f2c8 to your computer and use it in GitHub Desktop.
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:

image

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:

image

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:

image

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