git使用模板编辑commit message

创建commit message模板

1.创建一个名为commit.template的模板文件:

[problem description] : 
[rootcause] : 
[change] : 
[change type] : 
[side effects] : 
[reviewer] : 
[self test] : 
[test case] : 

2.在git中设置模板路径:

  • 只在当前git管理的代码中使用此模板,在当前代码的根目录下,打开终端或者命令行,输入如下命令:
    git config commit.template /home/xxx/commit.template

  • 全局使用这个commit message模板,输入如下命令:
    git config --global commit.template /home/xxx/commit.template

3.设置commit时使用的编辑器:

  • 配置当前:
    git config core.editor vim

  • 配置全局:
    git config --global core.editor vim

原文地址:https://blog.csdn.net/Shi_zhaopeng/article/details/130105368

posted on 2024-05-06 14:54  林西索  阅读(107)  评论(0编辑  收藏  举报