I've read Git branching and tagging best practices and git tagging comments - best practices, but I don't see a direct answer to something I've wondered for a long time:
Why does Git have tags? (instead of just branches)
They seem to be second-class citizens, or at least "different." They aren't pushed unless you specify that explicitly. Deletions of remote tags doesn't cause deletion in downstream repos.
This last point was a problem recently, as someone pushed a bunch of garbage tags with tons of commits from another repo. We could delete them upstream and gc the commits, but that wouldn't propogate, and the next time someone pushed a tag with git push --tags
, they'd repush those garbage tags and commits. So we had to make sure everyone deleted them.
When and why would I use a tag instead of a branch?