Inspect and Share Git Tags Safely
Find a release without switching branches
Continue the tags lab from lesson 1 (no optional practice required). A pattern filters tag names. Showing a file at a tag reads the saved file without switching branches or replacing local edits.
The list includes v1.0.0, the file contains Tea, and main remains checked out.
Share exactly one tag in an offline lab
A remote is another repository. The supplied lab provides a fresh sibling bare repository called remote.git, configured as origin; a bare repository has no ordinary working tree. Push means transfer objects and update selected remote refs. The explicit branch push below disables automatic following of annotated tags. Then send only the chosen tag. Do not run these commands against a real remote; the next chapter teaches general remote workflows.
git remote -vgit push --no-follow-tags origin maingit ls-remote --tags --refs origingit push origin refs/tags/v1.0.0:refs/tags/v1.0.0git ls-remote --tags --refs originThe first tag listing is empty in this fresh fixture. The second lists refs/tags/v1.0.0 with its tag object ID; checkpoint is not transferred. --tags on push would select all local tags. --follow-tags instead adds missing annotated tags reachable from refs being pushed.
Delete only a disposable local marker
Deletion removes a name, not necessarily its target object. Here checkpoint is a private local marker; verify it first, then delete it. Removing a local tag does not remove a same-named remote tag. Shared-tag deletion requires separate remote action and coordination; do not rewrite or remove release tags casually.
git show --no-patch checkpointgit tag -d checkpointgit tag --listgit ls-remote --tags --refs originThe local checkpoint name is gone. v1.0.0 remains locally and remotely. Practice: explain why a branch-only push and an explicit tag push have different results.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Inspect and Share Git Tags Safely — knowledge check
Reason about release markers, tag transfer and version naming.
What does git tag --list "v1.*" select?
After the explicit branch-only push in the fresh fixture, which tags are remote?
What does the explicit refs/tags/v1.0.0 push transfer?
What does git ls-remote --tags --refs origin inspect?
What happens remotely when a local tag is deleted?