Commit

A commit is a snapshot of a Git repository. Commits should be short, ideally representing an atomic change.

Commit message

A commit message can have a short summary, and an optional longer explanation after an empty line. Do not use emoji’s in commit messages like the gitmojiproject tries to achieve. Emojis do not provide any benefit to the commit message. There are still a lot of tools that lack proper emoji support. It is also way more difficult to filter or search commit messages when they use emojis for categorizing commits.

Use the following prefixes for commit message titles:

PrefixCategory
feat:New functionality
fix:Reworking existing code to solve bugs
refact:Refactoring code
docs:Adding documentation
test:Adding or fixing tests
bump:Incrementing version numbers of dependencies

A good convention to use is conventional commits. The commitlint project expands on this and adds more categories.

It is important to not introduce to many prefix categories. This will defeat the purpose if categorizing commits.

Undo commits

It might be desired sometimes to undo changes made by one or multiple commits. Prefer reverting over resetting commits to preserve the Git history.

See also