# 建議提交格式

建議以這種形式填寫提交訊息

Header:

<type>(<scope>): <subject>

  • type: 代表 commit 的類別:feat, fix, docs, style, refactor, test, chore,必要欄位。
  • scope 代表 commit 影響的範圍,例如資料庫、控制層、模板層等等,視專案不同而不同,為可選欄位。
  • subject 代表此 commit 的簡短描述,不要超過 50 個字元,結尾不要加句號,為必要欄位。

Body:

  • 72-character wrapped. This should answer:
  • Body 部份是對本次 Commit 的詳細描述,可以分成多行,每一行不要超過 72 個字元。
  • 說明程式碼變動的項目與原因,還有與先前行為的對比。

Footer:

  • 填寫任務編號(如果有的話).
  • BREAKING CHANGE(可忽略),記錄不兼容的變動, 以 BREAKING CHANGE: 開頭,後面是對變動的描述、以及變動原因和遷移方法。

# git commit Header

  • feat: 新增 / 修改功能 (feature)。
  • fix: 修補 bug (bug fix)。
  • docs: 文件 (documentation)。
  • style: 格式 (不影響程式碼運行的變動 white-space, formatting, missing semi colons, etc)。
  • refactor: 重構 (既不是新增功能,也不是修補 bug 的程式碼變動)。
  • perf: 改善效能 (A code change that improves performance)。
  • test: 增加測試 (when adding missing tests)。
  • chore: 建構程序或輔助工具的變動 (maintain)。
  • revert: 撤銷回覆先前的 commit 例如:revert: type (scope): subject (回覆版本:xxxx)。