Getting Started
Learn our commit convention
We like to have a clean project history. Our commits convention is inspired by Conventional Commits but customized with gitmoji to make it more visual and fun.
Structure
The commit message should be structured as follows and in lowercase:
<gitmoji> <type> <description> [(#<issue number>)]
[optional body]
[optional footer(s)]
Example
š update documentation contributors
- Add @jerembdn as a contributor
- Add @younesbessa as a contributor
Co-authored-by: Younes Bessa <younes@onruntime.com>
Most of the time, a simple one-liner is enough:
š update documentation contributors
Types
We use the following commit types:
| Type | Description |
|---|---|
add | Add a new feature |
fix | Fix a bug |
improve | Improve something |
update | Update something |
remove | Remove something |
refactor | Refactor something |
rename | Rename something |
move | Move a file or folder |
upgrade | Upgrade dependencies |
downgrade | Downgrade dependencies |
initial | Initial commit of a repository |
release | Release / version tag |
The first commit of a repository uses initial, and a version tag uses
release:
š initial commit
š release @onruntime/translations v0.3.0
Description
The <type> is the verb of the subject, and the description completes it. Read
together, they make one sentence:
# Good
š update documentation contributors
So don't open the description with a second verb. The type is already one, and
the subject ends up stacking two sentences, which is what a fix: prefix leads
to. Drop the verb and keep what it acted on:
# Bad
š improve scale down the gem on its card
š fix stop the footer from wrapping
# Good
š improve the gem size on its card
š fix the footer wrapping
Write it in imperative mood and lowercase:
# Bad
š updated documentation contributors
# Bad
š Update documentation contributors
A Verb That Is a Noun
Some words are both, and the one you mean is the noun: ⨠add open graph image
is fine. When it reads as a verb, an article makes it a noun phrase again:
⨠add a show more button.
Issue Number
Link commits to issues by adding the issue number:
š update documentation contributors (#123)
Body
Use the body for context and motivation:
š update documentation contributors
- Add @jerembdn as a contributor
- Add @younesbessa as a contributor
Co-authored-by: Younes Bessa <younes@onruntime.com>
One Commit, One Purpose
Each commit should represent a single logical change. Don't mix unrelated changes.