2015-12-18 02:04:11 +00:00
|
|
|
# git tag
|
|
|
|
|
|
|
|
> Create, list, delete or verify tags.
|
2024-02-14 20:25:13 +00:00
|
|
|
> A tag is a static reference to a commit.
|
2019-06-03 01:06:36 +01:00
|
|
|
> More information: <https://git-scm.com/docs/git-tag>.
|
2015-12-18 02:04:11 +00:00
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- List all tags:
|
2015-12-18 02:04:11 +00:00
|
|
|
|
|
|
|
`git tag`
|
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- Create a tag with the given name pointing to the current commit:
|
2015-12-18 02:04:11 +00:00
|
|
|
|
|
|
|
`git tag {{tag_name}}`
|
|
|
|
|
2018-01-10 10:52:20 +00:00
|
|
|
- Create a tag with the given name pointing to a given commit:
|
|
|
|
|
|
|
|
`git tag {{tag_name}} {{commit}}`
|
|
|
|
|
2016-01-13 11:32:49 +00:00
|
|
|
- Create an annotated tag with the given message:
|
2015-12-18 02:04:11 +00:00
|
|
|
|
|
|
|
`git tag {{tag_name}} -m {{tag_message}}`
|
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- Delete the tag with the given name:
|
2015-12-18 02:04:11 +00:00
|
|
|
|
|
|
|
`git tag -d {{tag_name}}`
|
2016-10-27 05:55:22 +01:00
|
|
|
|
2024-06-20 18:18:30 +01:00
|
|
|
- Get updated tags from remote:
|
2016-10-27 05:55:22 +01:00
|
|
|
|
|
|
|
`git fetch --tags`
|
2016-12-15 15:23:45 +00:00
|
|
|
|
2024-06-20 18:18:30 +01: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}}`
|