Skip to content

Instantly share code, notes, and snippets.

@theoparis
Created April 27, 2022 05:16
Show Gist options
  • Save theoparis/936cfe14eb0f539b87619bda9af2b965 to your computer and use it in GitHub Desktop.
Save theoparis/936cfe14eb0f539b87619bda9af2b965 to your computer and use it in GitHub Desktop.
Conventional commits

The most important prefixes you should have in mind are:

  • fix: which represents bug fixes, and correlates to a SemVer patch.
  • feat: which represents a new feature, and correlates to a SemVer minor.
  • feat!:, or fix!:, refactor!:, etc., which represent a breaking change (indicated by the !) and will result in a SemVer major.

Multiple Changes

You can use footers to represent multiple changes in a single commit.

feat: adds v4 UUID to crypto

This adds support for v4 UUIDs to the library.

fix(utils): unicode no longer throws exception
  PiperOrigin-RevId: 345559154
  BREAKING-CHANGE: encode method no longer throws.
  Source-Link: googleapis/googleapis@5e0dcb2

feat(utils): update encode to support unicode
  PiperOrigin-RevId: 345559182
  Source-Link: googleapis/googleapis@e5eef86

The above commit message will contain:

  1. an entry for the "adds v4 UUID to crypto" feature.
  2. an entry for the fix "unicode no longer throws exception", along with a note that it's a breaking change.
  3. an entry for the feature "update encode to support unicode".

⚠️ Important: The additional messages must be added to the bottom of the commit.

References

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