Git Commit Template 提交模板

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

效果:

原文地址:https://www.cnblogs.com/yeduweichengzhaoyu/p/14330682.html