🏷️ Tags (Etiquetas)
➕ Crear Tags
Tag Ligero
git tag v1.0.0
# Solo un puntero al commitTag Anotado (Recomendado)
git tag -a v1.0.0 -m "Version 1.0.0 - Primera release"
# Objeto completo: autor, fecha, mensajeTag en Commit Específico
git tag -a v0.9.0 abc123 -m "Version beta"👁️ Ver Tags
git tag # Listar todos
git tag -l "v1.8.5*" # Buscar por patrón
git show v1.0.0 # Ver detalles del tag
git describe # Tag más cercano⬆️ Compartir Tags
git push origin v1.0.0 # Push tag específico
git push origin --tags # Todos los tags
git push --follow-tags # Solo tags alcanzables🗑️ Eliminar Tags
# Local
git tag -d v1.0.0
# Remoto
git push --delete origin v1.0.0
git push origin :refs/tags/v1.0.0 # Forma antigua🎯 Casos de Uso
Semantic Versioning
# MAJOR.MINOR.PATCH
git tag -a v1.0.0 -m "Initial release"
git tag -a v1.1.0 -m "New features"
git tag -a v1.1.1 -m "Bug fixes"
git tag -a v2.0.0 -m "Breaking changes"Release Process
# 1. Completar desarrollo
git checkout main
git merge --no-ff release/v1.2.0
# 2. Crear tag
git tag -a v1.2.0 -m "Version 1.2.0
- Feature A
- Feature B
- Bug fixes"
# 3. Push
git push origin main --tags
# 4. Crear release en GitHub
# (puede hacerse automático con GitHub Actions)Checkout por Tag
git checkout v1.0.0 # Ver código de esa versión
git checkout -b hotfix-1.0 v1.0.0 # Crear rama desde tag📋 Convenciones
Semantic Versioning (SemVer):
MAJOR: Cambios incompatibles en APIMINOR: Funcionalidad nueva compatiblePATCH: Bug fixes compatibles
Ejemplos:
v1.0.0: Primera release establev1.1.0: Nuevas featuresv1.1.1: Hotfixv2.0.0: Breaking changes
Pre-releases:
v1.0.0-alphav1.0.0-beta.1v1.0.0-rc.1(release candidate)
Diferencias:
- Tag ligero: Solo puntero (como branch que no cambia)
- Tag anotado: Objeto completo con metadata (recomendado para releases)
Tip: Siempre usa tags anotados para releases públicos