首页 > 解决方案 > --follow-tags 似乎不适用于 `git push`

问题描述

这是我的复制品:

$ mkdir git-test
$ cd git-test
$ git init
$ echo "hello world" >> test_file.txt
$ git add .
$ git commit -m "made a change"
$ git tag v1.0.0
$ git push -u --follow-tags origin master

现在如果我去我的上游仓库,它有提交但没有标签!

   --follow-tags
       Push all the refs that would be pushed without this option, and also push annotated tags in refs/tags that are missing from the remote but are pointing at committish that are reachable from the
       refs being pushed.

那是从手册页。也许我误解了什么--follow-tags,但它不应该v1.0.0在将提交推送到上游时推送我的标签吗?

提前致谢!

标签: git

解决方案


推送远程缺少的 refs/tags 中的注释标签,但指向可从

git tag v1.0.0创建了一个轻量级的非注释标签。删除它并创建一个带注释的标签:

$ git tag -d v1.0.0
$ git tag -a v1.0.0

推荐阅读