Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

git

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!

like image 589
tstringer513 Avatar asked Jun 11 '19 14:06

tstringer513


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
like image 133
phd Avatar answered Nov 03 '22 00:11

phd