When fetching a single branch, git fetch
includes any tags that point into the branch:
When refspec stores the fetched result in remote-tracking branches, the tags that point at these branches are automatically followed. This is done by first fetching from the remote using the given s, and if the repository has objects that are pointed by remote tags that it does not yet have, then fetch those missing tags. If the other end has tags that point at branches you are not interested in, you will not get them.
Is there any way to make git push
behave the same way? The man page says how to push no tags (the default), all tags (--tags
), or ones you name on the command line. It doesn't give a way to push all the ones pointing into the branch.