For a detailed Guide follow this link. Else follow the guide given below.
Commit messages are written in the following format:
commit_type(scope): commit message
-
The
commit_type
can include the following types:- feat – used when a new feature is introduced
- fix – used when a bug fix is added
- chore – for changes that do not relate to a fix or feature and don't modify src or test files (for example updating dependencies, adding assets like images, config file changes)
- refactor – for "code refactor" changes, i.e changes in the code that neither fixes a bug nor adds a feature
- docs – for changes to the documentation such as the README.md or other markdown files
- style – for changes that do not affect the meaning of the code, likely related to code formatting such as white-space, missing semi-colons, and so on.
- perf – for performance improvements changes.
- ci – for changes related to continuous integration
- build – for changes that affect the build system or external dependencies
-
The
scope
can be a name of a page or a component. Mentioning a scope is optional. It should be mentioned whenever possible. Examples:home
,faq
,company
,header
,footer
etc. -
commit message
is a simple lowercase string that describes all the edits/changes you have made in your commit.
-
Suppose you added a feature in the home page and that feature is all about creating a new Events section.
- So, your commit message must look like this:
feat(home): new events section
- So, your commit message must look like this:
-
Suppose you fixed a bug in a global component. Lets say that global component is the Header component. You have fixed the onClick event of the button.
- So, your commit message must look like this:
fix(header): fix header component onClick event
- Observe that here
header
scope represents the Header component. The Header component is a global component. Global Components are the components that are used by more than one components/pages. Since this component does not belong to just a single page, we did not write the name of a page in the scope, instead, we wrote the name of the component (i,eheader
). - Also, observe that the commit message is always written in lowercase.
- So, your commit message must look like this: