【发布时间】:2020-09-28 20:55:41
【问题描述】:
有没有办法设置git tag 消息模板,类似于提交消息模板的工作方式?
使用git config,我们可以为提交配置一个模板,指向一些.git-msg-template。例如,在~/.gitconfig 中,这将如下所示:
[commit]
template = ~/.git-msg-template
但是,如果您通读 git 文档或只是在终端中查找git config tag.* 选项,似乎没有git config tag.template,只有git config commit.template 设置。
尽管如此,即使没有设置自定义 commit.template,提交和标签的默认消息对我来说也是不同的。提交以Please enter the commit message ... 开头,添加分支信息等等,而标签只有Write a message for tag: v1.0.0。因此,在内部,提交和标签应该有不同的模板?!
【问题讨论】: