【发布时间】:2013-08-21 06:40:33
【问题描述】:
在 git 中添加新标签时,我想在我的 $EDITOR 启动之前自动修改默认(空)标签消息 - 类似于 git 允许通过 prepare-commit-msg 钩子准备提交消息的方式。
例如:
git tag -s v1.2.3
应该用这样的预填充内容打开我的编辑器:
Release v1.2.3:
* Dynamically generated message 1
* Dynamically generated message 2
Default standard text.
#
# Write a tag message
# Lines starting with '#' will be ignored
有什么方法可以实现吗?不幸的是,prepare-commit-msg 钩子不适用于标签消息。 (要么这个,要么我太笨了,不知道怎么做。)
【问题讨论】:
-
注意:使用 Git 2.17(2018 年第二季度),现在还有一个
--edit选项到git tag。见stackoverflow.com/a/49215146/6309