How to Push Git Tags with Commit
When pushing code that has some tags to a remote repository, you need to first push the commits with:
git push
and then follow with:
git push --tags
Wouldn’t it be nice if you could push the commits and tags in one go? Well now you can by setting one simple config option:
git config --global push.followTags true
From the git documentation:
push.followTags If set to true enable –follow-tags option by default. You may override this configuration at time of push by specifying –no-follow-tags.
–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 commit-ish that are reachable from the refs being pushed.
References: