How to Write a Great Git Commit Message

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • gitmoji

    An emoji guide for your commit messages. 😜

  • After working on a number of projects that tried to apply conventional commits properly, I found something like this to be more effective and sustainable.

    Specifically, I'm quite fond of https://gitmoji.dev

    - Commit messages are shorter, even with ticket IDs.

    - Commit log is easy to read

    - Less prone to typos (chroe vs chore)

    - Easy to enforce with push rules

    - Easy to generate changelogs/release notes

    - Easy to measure (metrics)

    - Helpful IDE integrations

    - It's a bit more fun than conventional commits

    See https://github.com/tiangolo/fastapi for an example

  • fastapi

    FastAPI framework, high performance, easy to learn, fast to code, ready for production

  • After working on a number of projects that tried to apply conventional commits properly, I found something like this to be more effective and sustainable.

    Specifically, I'm quite fond of https://gitmoji.dev

    - Commit messages are shorter, even with ticket IDs.

    - Commit log is easy to read

    - Less prone to typos (chroe vs chore)

    - Easy to enforce with push rules

    - Easy to generate changelogs/release notes

    - Easy to measure (metrics)

    - Helpful IDE integrations

    - It's a bit more fun than conventional commits

    See https://github.com/tiangolo/fastapi for an example

  • SurveyJS

    Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.

    SurveyJS logo
  • React

    The library for web and native user interfaces.

  • For those who write multi paragraph commit bodys, is there a tool you use to format them?

    Example commit on the React repo [1]. It seems like a lot to type in the command line.

    [1] https://github.com/facebook/react/commit/ec52a5698e2dfea7050...

  • semantic-release

    :package::rocket: Fully automated version management and package publishing

  • I like the conventional commit style [0]. You may have seen these in open source repos or used them at work. They look like

    feat: support new line chart

    fix: update props for new line chart

    chore: bump dependency version

    What's also cool is there are tools (semantic release) that will then handle automatically publishing and/or creating a new version of your module based on these commits using on the commit type (feat, fix, chore etc) to determine how to bump the version [1].

    [0]https://www.conventionalcommits.org/en/v1.0.0/

    [1]https://github.com/semantic-release/semantic-release

  • Vim

    The official Vim repository

  • My vim will automatically wrap when I am typing a git commit message.

    I think somehow that gets set by default in here, but I don't actually see it:

    https://github.com/vim/vim/blob/master/runtime/syntax/gitcom... . It should be "set textwidth=..."

  • commit-emoji

    Performs a git commit with a random emoji message. 😂 🤙 🚀

  • 95% of the commits on my personal open source projects use emoji commit messages. https://github.com/transitive-bullshit/commit-emoji

    PRs matter a lot more than commit messages, especially if you're squashing + merging / rebasing.

  • kwote

    Create beautiful quotes that capture your attention.

  • Honest question, do you really expect your history to be meaningful long-term? Or are you simply taking the approach that the commit message is meaningless and a developer instead use GitHub search to find a PR relevant to a change they're investigating.

    For example, I pulled up one of your projects and the history (https://github.com/transitive-bullshit/kwote/commits/main) is less than meaningless, compared to i.e. using emojis as a shorthand (https://github.com/tiangolo/fastapi/commits/master)

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • swift

    The Swift Programming Language

  • Because there's a bunch of PRs that were being operated on in parallel, and some probably that are even kind of old, the view you wind up with is likely a large streak of "PR merged" commits and then all the commits from those PRs jumbled together in an incoherent mess. Likely you'd have to scroll a few pages to even find some of those PR's commits.

    [1] https://github.com/apple/swift/commits/main

  • GitHub Changelog Generator

    Automatically generate change log from your tags, issues, labels and pull requests on GitHub.

  • Interesting, I've been using github-changelog-generator [1] for (you guessed it) automatic changelog generation, which adds bug fixes/features to the changelog based on issues and PRs, but sematic-release looks like it might be even more useful.

    [1] https://github.com/github-changelog-generator/github-changel...

  • Interesting, I've been using github-changelog-generator [1] for (you guessed it) automatic changelog generation, which adds bug fixes/features to the changelog based on issues and PRs, but sematic-release looks like it might be even more useful.

    [1] https://github.com/github-changelog-generator/github-changel...

  • action-semantic-pull-request

    A GitHub Action that ensures that your PR title matches the Conventional Commits spec.

  • +1 on conventional commits (big fan)

    also, +1 on fully paved road approach!

    You might want to check out this GitHub Action to enforce PR title matches the spec: https://github.com/amannn/action-semantic-pull-request

  • rDrama

    Discontinued moved to https://fsdfsd.net/rDrama/rDrama

  • Sometimes I wonder about repos that do not follow any guideline. I use an open source service[0] that never describes what the commit is about, so just know that any description of the commit is better than none at all.

    [0]https://github.com/Aevann1/rDrama/commits/frost

  • git-plan

    Git Plan - a better workflow for git

  • I also have this problem, so I made a tool that lets you write your commit messages in-advance. It helps me to focus on one problem at a time.

    One feature I wanted to add was for it to parse your source code for comments with a specific format (e.g. `# git-plan feat xyz` or `# git-plan fix xyz`) and then stitch all the hunks together into commits for you. So all you'd have to do is comment your code and then run `git plan commit` and it would generate commits for you to confirm with y/n.

    https://github.com/synek/git-plan

    (I haven't worked on it for a while though)

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts