Here's what I did...
git checkout -b test-branch
### add a line of text to a .md file, then...
git commit -am 'a commit that will never be pushed'
git tag my-tag
git push --tags
### NOTE: I ONLY pushed the tag (not the branch)
So...
I have not pushed the commit
I have not pushed the branch the commit is on
But...
When I view the tag in github
Then click on the associated SHA
I see the actual (un-pushed) commit

I thought a Tag was only a pointer to a SHA.
How is it I am seeing the contents of an un-pushed commit? And what is going on?
I have not pushed the commit
Yes you have, whether you know it or not, otherwise the remote would reject the tag.
You never "push the commits" manually, you push them implicitly while pushing a branch or tag that references the commits. Tags and branches are more or less identical. Commits are not "on branches", anymore than they are "on tags". Branches and tags are pointers to commits, and when you push one of either type, the commits it references must also be pushed.
The same way you don't have to ask Git to specifically download all the commits when you check out a branch. Git does this for you.
I thought a Tag was only a pointer to a SHA (not a container for commits...)
Yes, exactly the same as a branch. They're both just pointers to commit IDs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With