What happens if I push a tag for a commit that hasn't been pushed

Pushing a tag means pushing everything necessary for the tag, just like pushing a branch does. This means pushing the commit it points to, which means pushing the tree for that commit, and the subtrees of that tree, and the blobs in the trees, and the ancestors of that commit, and so on. It just doesn't make any sense to push a ref without pushing the corresponding objects, so Git wouldn't ever do it.


All of the objects needed for that tag will be pushed, but any other references (like HEAD or master) won't be updated. So while the changes you made and your tags will be in the remote repository, anyone who does a pull on master (or whatever branch you're using) won't yet see your commit on their copy of the branch.

Tags:

Git