Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

remote tag not shown in local

Tags:

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 when I git pull and then run git tag in my environment, I expect to see a list of all the tags. I can see other tags that were pushed to repo in the similar way, but not this particular one. I want to find out how/where did this tag get 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 git tag Thanks!

like image 309
user_stackoverflow Avatar asked Jun 28 '13 00:06

user_stackoverflow


People also ask

How do I display a remote tag?

In order to list remote Git tags, you have to use the “git ls-remote” command with the “–tags” option and the name of your remote repository.

How do I find my remote branches?

To view your remote branches, simply pass the -r flag to the git branch command. You can inspect remote branches with the usual git checkout and git log commands. If you approve the changes a remote branch contains, you can merge it into a local branch with a normal git merge .


1 Answers

Unfortunately, git pull doesn't fetch tags by default. You need to run git fetch --tags, and then you'll have them.

The default behavior of git pull and git fetch is to only retrieve tags that are directly accessible by the current references. If any tags are not, then those are not fetched. Passing --tags to git fetch tells git that you want them all, whether they're reachable by current references or not.

like image 200
John Szakmeister Avatar answered Jan 04 '23 07:01

John Szakmeister