在git中添加新標籤時,我希望在$ EDITOR啓動之前自動修改默認(空)標籤消息 - 類似於git允許通過prepare-commit-msg
鉤子準備提交消息的方式。有沒有辦法編寫git標籤消息?
例如:
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(Q2 2018),現在還有'--edit'選項可用於'git tag'。請參閱https://stackoverflow.com/a/49215146/6309 – VonC