【发布时间】:2020-01-21 22:01:06
【问题描述】:
在 git 中修改轻量级标签按预期工作。
git tag -f <tagname> <commit-id>
但是对带注释的标签使用相同的标签似乎会造成麻烦-
$ git cat-file -t tag2rag
tag
和
$ git cat-file -p tag2rag
object a7b4b4823f0222b79376e4c16bdbba0f3d1f5d33
type commit
tag tag2rag
tagger samshers <email@gmail.com> 1568930032 +00:00
tag to rag
那么,
$ git tag -f tag2rag 3096b
Updated tag 'tag2rag' (was 8931274)
那么,意想不到的
$ git cat-file -t tag2rag
commit
和
$ git cat-file -p tag2rag
tree b0053bf300da86e5aeabafb29d7dedcdbf713d51
parent 49c74fafd7c69e938052a4cba96ad62999438413
author samshers <email@gmail.com> 1568910804 +0000
committer samshers <email@gmail.com> 1568910804 +0000
wowfiles in
免责声明:嗯,我承认在发布后更改标签不是一个好的做法,并且可能会导致更多的协作问题。相反,应该创建并发布一个新标签。
那么这里的目的是了解 git 以及如何在 git 中做事。
关于如何编辑带注释标签的任何建议。
【问题讨论】: