git commit添加模板
在工作中为了规范大家的git提交,往往要求commit信息统一规范,在此情况下可以添加git commit模板,这样方便大家提交统一格式的commit信息,并且可以提高效率,具体方法如下:
一 编辑模板文件gittemp
添加示例内容如下:
[JIRA-ID][Component] Short Description of the change
More detail description.
二 使用下面命令使生效
git config --global commit.template gittemp
三 git commit内容添加签名
如果想在commit中添加作者签名,使用**-s**指令,如下
git commit -s
此时当我们输入git commit -s时就会自动创建如下commit内容
[JIRA-ID][Component] Short Description of the change
More detail description.
Signed-off-by: JiuWuyou <JiuWuyou@abc.com> #签名信息会自动提取git配置