67db91dd-3847-4b3f-9b8d-392.../docs/09-tagging.md

641 B

Tagging

Goal

Create and list tags and share them with remotes.

Lightweight vs Annotated Tags

  • Lightweight: just a name pointing at a commit.
  • Annotated: includes metadata (message, tagger), recommended for releases.

Create Tags

cd ~/lab-git-essentials/my-first-repo

# Lightweight
git tag v0.1

# Annotated
git tag -a v1.0 -m "First stable release"

# List tags
git tag -n

Inspect a Tag

git show v1.0

Push Tags to Remote

git push origin v1.0          # push a single tag
git push origin --tags        # push all tags

Outcome

You can create, view, and push tags for versioning.