Git Commit Message Types for Bloggers and Writers

Conventional commit types assume software releases, so a blog repository ends up with feat: and fix: for very different work. This guide lists eleven commit types designed for writers: post, edit, update, design, build, fix, ci, a11y, perf, refactor and revert.

By
Brennan Kenneth Brown
Published
Reading time
4 minutes
Level
Beginner
You need
  • A blog or writing project in a git repository
Close-up of a handwritten ledger page with ruled columns
Ledger Accounting', 2017. | PxHere (edited by the Author)

Git commit message types for a blog should describe writing work, not software releases. On my site, Brennan.day, I followed the Conventional Commits style and, across over a thousand commits, 448 were prefixed feat: and 417 were fix:. A new 2,000-word essay was feat:. A corrected typo was fix:. An automated comment sync at 3am was feat:. A CI pipeline toggle was feat:. Everything was flattened into two buckets and the changelog lost its meaning.

This guide is for writers and bloggers who use git mainly to maintain their writing. It lists the eleven commit types I now use, after a short look at where typed commits came from.

Where do typed commit messages come from?

The modern convention for structured commit messages starts with Tim Pope in April 2008, writing a now-famous post as a contributor to the Rails project.

His focus was structure rather than type prefixes:

  • keep the subject line under fifty characters
  • wrap the body at seventy-two characters
  • write in the imperative mood ("Fix bug", not "Fixed bug").

Pope established the grammar of a well-formed commit. Git itself, he argued, was designed with this structure in mind: git log --oneline, git shortlog, git rebase. All of these commands assume a subject line that can stand alone as a complete thought.

The type-prefix convention came later. Igor Minar and Vojta Jína introduced it while working on Angular in 2011. Their original AngularJS contributing guidelines specified a format of <type>(<scope>): <subject> with a fixed vocabulary: feat, fix, docs, style, refactor, perf, test, chore.

The stated goals were explicit: allow automated changelog generation, allow ignoring unimportant commits when using git bisect, and provide better information when browsing history.

That convention was eventually generalized into the Conventional Commits specification, a proper versioned standard that formalized the format. The specification's most important design decision was to tie feat: and fix: to Semantic Versioning: a feat: commit signals a minor version bump (for example, 0.1.0 to 0.2.0), and a fix: signals a patch (for example, 0.1.0 to 0.1.1).

Tools like semantic-release can then read your commit history and automatically determine the next version of your npm package, without a human needing to make the call.

Why do conventional commits not fit a blog?

The system above was designed for people publishing npm packages and software libraries.

A blog has no public API and no semantic version. Publishing a new essay is not a MINOR release, and correcting a typo is not a PATCH. The vocabulary does not align.

The original Angular type list has no way to distinguish the writing of "new blog post published" from "automated comment sync." Both would reach for feat:. Likewise, there isn't any way to distinguish "corrected a sentence in an old post" from "fixed a null pointer in the comment fetcher" as both would use fix:.

My changelog became illegible because the categories were not useful. Some days are writing-heavy, some are design-heavy, and some are coding-heavy. Under feat: and fix:, that information disappeared.

What are the eleven commit types for writers?

Since this is my site and I am the sole maintainer, I changed the rules. After auditing my commit history to see the real distribution of work, I arrived at these eleven types. Use the format type: short subject in the imperative mood.

Type Use it for Replaces
post: A new essay, blog post, or other published written content. When there is a post: in the log, something was written. feat: for new content
edit: Corrections, revisions, or expansions to existing written content. A typo is not a bug. fix: for prose
update: Routine data or content refreshes: comment syncs, stats refreshes, now page tweaks, adding friends to the blogroll. This absorbs the automated churn that previously used feat:. feat: for automated changes
design: Visual, layout, and CSS changes. A new CSS animation goes here. style:
build: Site infrastructure, config, tooling, and dependency changes. A new Eleventy shortcode goes here. chore:
fix: Actual code bugs only. Far narrower than in Conventional Commits. Narrowed fix:
ci: Continuous Integration (CI) and Continuous Delivery/Deployment (CD) work, such as a CI pipeline toggle. feat: for pipeline changes
a11y: Accessibility improvements: ARIA labels, contrast fixes, alt text, and semantic HTML. None
perf: Performance improvements: build speed, asset sizes, caching. See improving a Lighthouse score and speeding up Eleventy builds. perf: kept
refactor: Code restructuring without behaviour change. See refactoring an Eleventy config. refactor: kept
revert: Undoing a previous commit. revert: kept

This is opinionated, but content-focused prefixes make the history read like a blog's history instead of a software project's. edit: separates typos from fix: for bugs. I retired feat: entirely, so new features go in design: or build: depending on what they are.

What does the changelog look like with these types?

The commit history can work as a parallel text to the blog. Posts and commits are records of the same practice at different zoom levels. An active week now reads like a diary: a few post: entries, some edit: corrections as I noticed things after publishing, an update: or two from automated comment syncs, maybe a design: or a11y: if I'd been tinkering. That is a more accurate account of what happened than twelve feat: commits and fifteen fix: commits. Careful commit messages also help anyone who browses the source on GitLab, including future you. Every commit is a sentence, and it should say what it means.

The full convention, with a complete table and examples, is documented in my CONTRIBUTING.md doc and on the colophon page of the site.