--follow-tags似乎不适用于`git push`

时间:2019-06-11 14:08:42

标签: git

这是我的副本:

$ 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标签吗?

谢谢!

1 个答案:

答案 0 :(得分:1)

  

带注释的标签推入远程丢失的refs / tags中,但指向可从

访问的commitish

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

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