<type>(<scope>): <subject>
-
feat:新功能(feature)
-
fix:修補bug
-
docs:檔案(documentation)
-
style: 格式(不影響程式碼執行的變動)
-
refactor:重構(即不是新增功能,也不是修改bug的程式碼變動)
-
test:增加測試
-
chore:構建過程或輔助工具的變動
-
以動詞開頭,使用第一人稱現在時,比如change,而不是changed或changes
-
第一個字母小寫
-
結尾不加句號(.)
INVALID COMMIT MSG: does not match "(): " !
jartto:fix bug
git stash
git rebase 9633cf0919^ --interactive
git stash pop
npm install --save-dev validate-commit-msg
{
"types": ["feat", "fix", "docs", "style", "refactor", "perf", "test", "build", "ci", "chore", "revert"],
"scope": {
"required": false,
"allowed": ["*"],
"validate": false,
"multiple": false
},
"warnOnFail": false,
"maxSubjectLength": 100,
"subjectPattern": ".+",
"subjectPatternErrorMsg": "subject does not match subject pattern!",
"helpMessage": "",
"autoFix": false
}
{
"config": {
"validate-commit-msg": {
/* your config here */
}
}
}
{
…
"config": {
"ghooks": {
"pre-commit": "gulp lint",
"commit-msg": "validate-commit-msg",
"pre-push": "make test",
"post-merge": "npm install",
"post-rewrite": "npm install",
…
}
}
…
}
-
提供更多的資訊,方便排查與回退;
-
過濾關鍵字,迅速定位;
-
方便生成檔案。
-
New features
-
Bug fixes
-
Breaking changes
npm install -g conventional-changelog
cd jartto-domo
conventional-changelog -p angular -i CHANGELOG.md -w
{
"scripts": {
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -w -r 0"
}
}
npm run changelog
-
http://www.ruanyifeng.com/blog/2016/01/commit_message_change_log.html
-
https://www.aliyun.com/jiaocheng/125261.html
-
https://www.npmjs.com/package/ghooks
-
https://github.com/conventional-changelog-archived-repos/validate-commit-msg
-
https://github.com/conventional-changelog/conventional-changelog