Git 配置提交信息编辑器vim
git config --global core.editor vim
Git 配置提交信息模板
提交信息规范:
第一行:Jira单号: 提交信息标题(标题简短明了即可)
第二行:空行
第三行:可以详细说明该提交
编辑提交信息模板文件
新建一个空文件 .git-commit-template.txt,文件名随意,然后把以下内容复制到该文件中,保存。
#Jira-issue: Commit subject
#Detailed description of issue
#1.A
#2.B
#3.C
将编辑好的文件复制到用户的根目录下
cp .git-commit-template.txt ~
执行配置模板命令
git config --global commit.template ~/.git-commit-template.txt
当执行了 git add,git commit 以后,会弹出该模板,进行编辑,wq保存退出。