Remote tag not displaying locally

I am new to using git and tags. My team member ran the following commands:

git tag v1.27.1 git push origin v1.27.1 

Now that I have git pull and then run the git tag in my environment, I expect to see a list of all the tags. I can see other tags that have been ported to the repo in a similar way, but not in this particular one. I want to know how / where this tag is lost. How can i do this? What should be my approach?

Also, my team member who created the tag can see the tag on his machine when he runs the git tag Thank you!

+4
source share
2 answers

Unfortunately, git pull does not retrieve the default tags. You need to run git fetch --tags and then you will get them.

The default behavior of git pull and git fetch is to only receive tags that are directly accessible by current links. If any tags are missing, then they are not retrieved. Passing --tags to git fetch tells git that you want them all, whether they are accessible via current links or not.

+22
source

By default, the git push command does not pass tags to remote servers. You will have to explicitly click tags on the shared server after they are created. This process is similar to splitting remote branches - you can run git push origin <tagname> .

If you have many tags that you want to click at the same time, you can also use the -tags [ git push --tags ] git push --tags for the git push command. This will transfer all your tags to a remote server that does not yet exist.

Now that someone else is cloning or pulling from your repository, they will also receive all your tags.

A source

0
source

Source: https://habr.com/ru/post/1488606/


All Articles