1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-07-30 07:35:29 +02:00
tldr/pages/common/git-tag.md
Managor db25f60eb1
git-*: convert options to longform and minor fixes (#13441)
Co-authored-by: spageektti <git@spageektti.cc>
Co-authored-by: Fazle Arefin <fazlearefin@users.noreply.github.com>
2024-08-31 13:06:48 +02:00

746 B

git tag

Create, list, delete or verify tags. A tag is a static reference to a commit. More information: https://git-scm.com/docs/git-tag.

  • List all tags:

git tag

  • Create a tag with the given name pointing to the current commit:

git tag {{tag_name}}

  • Create a tag with the given name pointing to a given commit:

git tag {{tag_name}} {{commit}}

  • Create an annotated tag with the given message:

git tag {{tag_name}} -m {{tag_message}}

  • Delete the tag with the given name:

git tag {{--delete|-d}} {{tag_name}}

  • Get updated tags from remote:

git fetch --tags

  • Push a tag to remote:

git push origin tag {{tag_name}}

  • List all tags whose ancestors include a given commit:

git tag --contains {{commit}}