Git tags
Git crea dos tipos de tags: ligeros (lightweight) y anotados (annotated). El tag ligero no contiene información extra (autor, mensaje, fecha, sha1) ni se guarda como un objeto en la bd de git entonces se utiliza como rama temporal/local. El tag anotado sí se guarda como objeto y contiene una fecha, autor, mensaje, entonces se utiliza para crear etiquetas de versiones.
Annotated tags are meant for release while lightweight tags are meant for private or temporary object labels.
You should only push annotated tags to the remote, and keep lightweight tags for local development to avoid tag clashes
git tag -a <tagname> -m "<tag message> feature is released in this tag."
crea un annotated tag
git tag <tagname>
crea un lightweight tag
git tag
Lista los tags existentes
git tag -n9
: Lista los tags existentes junto con el mensaje de cada uno
git tag -d <tagname>
Elimina un tag
Cuando haces un push del repositorio no incluye los tags, por lo tanto hay que enviarlos explicitamente.
git push origin <tag_name>
: Enviar un tag a remoto
git ls-remote --tags origin
: Listar los tags remotos
git push --delete origin tagname
: Elimina un tag remoto