Commit¶
良好 Git Commit 格式¶
<type>
:本次提交的類型,例如 feat, fix, docs, refactor...<scope>
:可選,指出修改影響的模組/檔案/功能範圍<short summary>
:簡潔描述改動(50 字以內)
常見 type 範例
Type | 說明 |
---|---|
feat |
新增功能 |
fix |
修復 bug |
docs |
文件修改(README、註解等) |
style |
排版、格式調整(不影響邏輯的變更) |
refactor |
重構程式碼,未新增功能或修 bug |
test |
新增或修改測試 |
chore |
工具設定調整、建置流程等非業務邏輯內容 |
perf |
效能優化 |
ci |
與 CI/CD 自動化流程相關的改動 |
commit 範例
feat: add parameterized publisher message_prefix
fix(action): prevent client from crashing on server disconnect
docs(README): add usage example for launch file
style(py_srvcli): reformat with black auto-formatter
refactor(cpp_pubsub): extract common logic to base class
chore: update .gitignore for log files and VSCode config
test(py_action): add unit test for Fibonacci callback
perf: reduce CPU usage during loop closure