In a project in my GitHub repository I’ve been tagging the project and pushing the tags:
git push --tags
The tags appear correctly in the GitHub repository, however I work with this project in different machines, and in some machines I lack some of the tags.
But if I make a git pull:
git pull origin master
The code is updated but the tags are not, meaning I only have the tags created on that machine and I don’t get the rest from GitHub.
How can I get all the tags from GitHub into my local repository?
When you fetch from a remote it should bring with it the tags. But only if they’re pointing to objects tracked from branch heads.
To explicitly grab all tags, no matter if they’re not reachable from a branch head or not, you’ll need to use the
--tagsflag.The above will pull down all tags that are on the origin repo.