所以两个月前,我将我们在 SVN 中的代码库迁移到 Git 中,并带有完整的变更集历史记录。紧接着,我们标记了一个新版本并继续工作。因此,在我们继续使用新标签工作的同时,一些人继续修复 SVN 中旧标签中的错误,现在我想将所有这些更改 pull 入 Git 中的那个标签。
我可以克隆标签并让 Git 允许我向其中提交,但我无法使用 git-push 推送任何内容。检查 git-log,提交在那里,但 git-st 告诉我我目前不在任何分支上。
那么互联网,我怎么能提交一个旧的 git 标签呢?
最佳答案
如果有人在搜索“replace git tag”或类似的东西后来到这里,我推荐以下方法:
git tag -d <tagname>
git checkout <new commit or branch>
git tag -a <tagname>
git push <remotename> <tagname> -f
例如:
git checkout 2.0
git tag -d v2.0
git tag -a v2.0 -m"Version 2.0"
git push origin v2.0 -f
希望这对某人有帮助。
关于git - 我如何提交到旧的 git 标签?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4150944/