tldr/pages/common/git-tag.md

38 lines
733 B
Markdown
Raw Normal View History

# 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 -d {{tag_name}}`
- Get updated tags from remote:
`git fetch --tags`
2016-12-15 15:23:45 +00:00
- Push a tag to remote:
`git push origin tag {{tag_name}}`
2017-01-05 13:05:56 +00:00
- List all tags whose ancestors include a given commit:
2016-12-15 15:23:45 +00:00
2017-01-03 19:32:35 +00:00
`git tag --contains {{commit}}`