Git中設置template步驟:
1.項目根目錄下設置提交模版commit.template,文件名為:commit_template
內容如下:
feat|fix|docs|test|(<scope>): <subject> #TASK_NAME <BLANK LINE> <body> <BLANK LINE> In Progress|Closes:[#TASK_NAME](http://)
- feat: 新功能
- fix: 修復bug
- docs: 只有文檔改變
- style: 並沒有影響代碼的意義(空格,去掉分號,格式的修改等)
- refactor: 代碼的修改並沒有修改bug,也沒有添加新功能
- perf: 代碼的修改提高的性能
- test: 添加測試
- chore: 構建過程或構建工具的改變(並沒有生產環境代碼的改變)
2.運行git命令,設置模板
$ git config --global commit.template /E/my-project/commit_template
3.執行git add 文件
4.git commit
5.進入模板填寫頁面,填寫完信息后,esc鍵退出插入模式,:wq退出編輯並保存信息。
6.git push
效果: