What is a Commit Line?
A commit line is a concise message you provide when making a commit in version control systems like Git. It explains the purpose or the changes introduced in the commit.
A good commit line should be short, precise, and easy to understand, allowing anyone in the project to grasp the essence of the changes.
Use a standardized syntax (Conventional Commits): Adopt prefixes to categorize the type of commit:
"options": [
{
"label": "---",
"value": ""
},
{
"label": "build",
"description": "Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)"
},
{
"label": "chore",
"description": "Updating grunt tasks etc; no production code change"
},
{
"label": "ci",
"description": "Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)"
},
{
"label": "docs",
"description": "Documentation only changes"
},
{
"label": "feat",
"description": "A new feature"
},
{
"label": "fix",
"description": "A bug fix"
},
{
"label": "perf",
"description": "A code change that improves performance"
},
{
"label": "refactor",
"description": "A code change that neither fixes a bug nor adds a feature"
},
{
"label": "revert"
},
{
"label": "style",
"description": "Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)"
},
{
"label": "test",
"description": "Adding missing tests or correcting existing tests"
}
],
When you run git change log it will look like below
How to use commit line for project
We hope that when committing in the wrong format, an error message will be reported
Package needs to be installed
yarn add -D @commitlint/cli
yarn add -D @commitlint/config-conventional
yarn add -D @commitlint/load
yarn add -D husky
yarn add -D lint-staged
You need commit link reference
https://bitbucket.org/main-28/commitline/commits/7fb8faaf2ed576fca80007bf099fe85f526e5605
Full source code:
https://bitbucket.org/main-28/commitline/src/main/
Top comments (1)
(づ ̄3 ̄)づ╭❤️~