--follow-tags doesn't seem to be working on `git push`

Viewed 1402

Here's my repro:

$ 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

Now if I go to my upstream repo, it has the commit but not the tag!

   --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.

That's from the man pages. Maybe I'm misunderstanding what --follow-tags does, but shouldn't it have pushed my v1.0.0 tag when it pushed the commit to upstream?

Thanks in advance!

1 Answers

push annotated tags in refs/tags that are missing from the remote but are pointing at committish that are reachable from the

git tag v1.0.0 created a lightweight, non-annotated tag. Delete it and create an annotated tag:

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