« Git Commandes » : différence entre les versions
Aucun résumé des modifications |
|||
| Ligne 8 : | Ligne 8 : | ||
git log -1 HEAD | git log -1 HEAD | ||
</pre> | </pre> | ||
==Tag== | ==Tag== | ||
===Création=== | Cherche le tag le plus récent dans l'historique du commit actuel. | ||
< | <syntaxhighlight lang="bash" line copy> | ||
git describe --tags | |||
</syntaxhighlight> | |||
=== Création === | |||
<syntaxhighlight lang="bash" line copy> | |||
git tag -a v2.4.2 -m "Le message du commit" | git tag -a v2.4.2 -m "Le message du commit" | ||
git push --tags | git push --tags | ||
</ | </syntaxhighlight> | ||
===Suppression=== | === Suppression === | ||
< | <syntaxhighlight lang="bash" line copy> | ||
git tag -d v2.4.1 | git tag -d v2.4.1 # retire le tag dépôt local | ||
git push origin :refs/tags/v2.4.1 | </syntaxhighlight> | ||
<syntaxhighlight lang="bash" line copy> | |||
===Voir=== | git push origin :refs/tags/v2.4.1 # retire le tag du repo distant | ||
< | </syntaxhighlight> | ||
=== Voir === | |||
<syntaxhighlight lang="bash" line copy> | |||
git show v2.4.1 | git show v2.4.1 | ||
</pre> | </pre> | ||
===Renommer=== | === Renommer === | ||
< | <syntaxhighlight lang="bash" line copy> | ||
git tag v1.0.2 v1.0.2^{} -f -m " | # conversion en tag annoté avec message | ||
git tag v1.0.2 v1.0.2^{} -f -m "message détaillé" | |||
# Efface tous les tags distants non présents localement. | |||
# Peut écraser des tags créés par d'autres sans garde-fou. | |||
git push -f origin --tags | git push -f origin --tags | ||
</pre> | </pre> | ||
===Renommer (Alternative moins risquée) === | |||
<syntaxhighlight lang="bash" line copy> | |||
# 1. Mise à jour locale du tag | |||
git tag -fa v1.0.2 -m "Nouveau message" | |||
# 2. Suppression du tag distant | |||
git push origin :v1.0.2 | |||
# 3. Push du nouveau tag | |||
git push origin v1.0.2 | |||
</syntaxhighlight> | |||
== Dépot == | == Dépot == | ||