Tags Are Database Snapshots You Can Name

Branches move. Every time you commit to a branch, it advances. That’s the point — branches are living, growing things.

But sometimes you need to mark an exact point in time and know it will never change. Before a risky migration. After a successful deployment. At the moment you ship version 2.0.

In SQL Server, you’d create a database snapshot. In git, you create a tag.

A gallery hallway with framed photographs labeled with version numbers showing a city growing over time. A woman curator hangs a new gold frame for the latest release.

A Tag Is CREATE DATABASE SNAPSHOT

That snapshot captures the database at that exact moment. No matter what happens next — schema changes, data modifications, disasters — you can always go back to that snapshot.

A git tag does the same thing:

That tag is permanently attached to the current commit. The branch will keep moving forward, but the tag stays right where you put it. It’s a photograph, not a living thing.

Lightweight vs. Annotated Tags

Git has two types of tags:

Lightweight tags are just a name pointing to a commit. No metadata, no message.

Annotated tags include who created the tag, when, and why. They’re stored as full objects in the git database.

Always use annotated tags for anything important. The metadata matters when you’re looking back six months later trying to figure out what version was running when that incident happened.

It’s the difference between a snapshot with a description and a snapshot with just a timestamp.

Listing and Inspecting Tags

That’s your audit trail. Who tagged it, when, why, and exactly which commit it points to.

Using Tags as Rollback Points

Here’s the DBA-critical use case. Before you do anything risky:

You’re now looking at the exact state of your code before the migration. You can create a new branch from here, or just inspect what things looked like.

This is RESTORE DATABASE FROM SNAPSHOT — go back to the known-good state and work from there.

Semantic Versioning

Most teams use tags for release versioning. The convention is semantic versioning:

For database projects, you might version your schema:

Each tag is a permanent record of exactly what the schema looked like at that version.

Pushing Tags to the Remote

Tags are local by default. To share them with your team:

Until you push a tag, it only exists on your machine — just like a database snapshot only exists on the server where you created it.

Tags vs. Branches: The Key Difference

This is worth stating clearly because it trips people up:

A branch moves. Every new commit advances the branch pointer. It’s a living, growing thing — like a database that’s actively being modified.

A tag stays. It permanently marks one specific commit. It’s a snapshot — frozen in time.

Use branches for ongoing work. Use tags for milestones, releases, and safety checkpoints.

Try This Yourself

The One Sentence to Remember

A tag is CREATE DATABASE SNAPSHOT — a permanent, named bookmark you can always return to, no matter how far the branch moves after it.

Previously: Rebase Is ALTER TABLE on Your Commit History
Next up: Cherry-Pick Is Cross-Database INSERT…SELECT

Got questions? Find me on Bluesky or LinkedIn.