一、格式化Commit message的好處:
- 提供歷史信息,方便瀏覽。
- 提取過濾commit。
- 從commit中提取console log。
二、Commit message的格式
- <type>(<scope>):<subject>
- //空一行
- <body>
- //空一行
- <footer>
其中Header是必需的,body和footer可以省略。
1.type
用于說明commit的類別。
feat : 新功能(feature )
fix : 修補(bǔ)bug
docs:文檔(documentation)
style: 格式(不影響代碼運(yùn)行的變動(dòng))
refactor: 重構(gòu)(既不新增,也不修改bug的代碼變動(dòng))
test:增加測(cè)試
chore:構(gòu)建過程或輔助工具的變動(dòng)
2.subject
commit目的的簡(jiǎn)短描述,不超過50個(gè)字符。
- 動(dòng)詞開頭,比如change,而不是changed或changes
- 第一個(gè)字母小寫
- 結(jié)尾不加句號(hào)
3.**body **
說明變動(dòng)的動(dòng)機(jī),以及與以前行為的對(duì)比
4.footer
只用于兩種情況。
- 不兼容代碼。以BREAKING CHANGE開頭,后面是描述、變動(dòng)理由和遷移方法。
<code>
BREAKING CHANGE: issolate scope bingings definition has changed.
To migrate the code follow the example below:
Before:
scope:{
myAttr:'attribute'
}
After:
scope:{
myAttr:'@',
}
The removed 'inject 'wasn't generaly useful for directives so there should be no code using it.
</code> - 關(guān)閉issuse.