ADVERTISEMENT
Google AdSense Slot (headerLeaderboard)

Set your Publisher ID in src/config/ads.ts to display live ads.

Git Version Control Tutorial• 6 min read

Git Tags, Semantic Versioning & .gitignore

Annotated tags (v1.0.0), release points, and structuring production .gitignore files

Tags mark specific points in repository history as important release versions (e.g. v1.0.0). The .gitignore file prevents secret tokens and temporary build artifacts from leaking into Git.

Tags and .gitignore Architecture

Lightweight Tags: Just a bookmark to a commit (git tag v1.0.0-beta).

Annotated Tags: Full Git objects stored with tagger name, email, date, and cryptographic GPG signature (git tag -a v1.0.0 -m "Release version 1.0.0").

Pushing tags: Tags are not pushed automatically with git push. You must run git push origin v1.0.0 or git push origin --tags.

Production .gitignore: Excludes node_modules/, .env* secrets, build/, and OS temp files (.DS_Store).

Production .gitignore File Example
# Dependencies
node_modules/
.pnp
.pnp.js

# Environment variables & secrets (CRITICAL: never commit!)
.env
.env.local
.env.production

# Build outputs
dist/
build/
.next/
out/

# IDE & OS noise
.DS_Store
Thumbs.db
.vscode/
Proper .gitignore protects against security breaches and repository bloat.
ADVERTISEMENT
Google AdSense Slot (inContentBanner)

Set your Publisher ID in src/config/ads.ts to display live ads.

Test Yourself With Exercise

+15 XP

Why are `.env` files universally included in `.gitignore` files?