Git Commit Message
May 3, 2021
最近開始嘗試使用 React.js 做一個小專案,並想將程式碼整理到 GitHub 上。
目前打算先從最小可行性產品(MVP)開始開發一版,之後陸續增加更多功能,因此希望自己的 commit 要能幫助未來的自己好維護和延伸開發。
上網查看了一些資料,看到有一篇說明得很棒,原文網址:https://wadehuanglearning.blogspot.com/2019/05/commit-commit-commit-why-what-commit.html
我將參考裡面提到的 type 分類實作。
type 只允許使用以下類別:
- 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)