git-tag is the Git command used to create, list, delete or verify a tag object signed with GPG. A tag is used to mark specific points in history as being important.
Questions tagged [git-tag]
543 questions
188
votes
2 answers
Checking out Git tag leads to "detached HEAD state"
I'm developing a deployment script for my git project and I just started using tags. I've added a new tag called v2.0:
git tag -a v2.0 -m "Launching version 2.0"
And I've pushed this tag to the remote repository
git push --tags
When I try to…

Khriz
- 5,888
- 6
- 34
- 39
173
votes
9 answers
“tag already exists in the remote" error after recreating the git tag
I get the following error after I run the steps below:
To git@provider.com:username/repo-name.git
! [rejected] dev -> dev (already exists)
error: failed to push some refs to 'git@provider.com:username/repo-name.git'
hint: Updates were…

Luca Boieru
- 2,260
- 4
- 17
- 15
152
votes
6 answers
Why should I use tags vs. release/beta branches for versioning?
I've been using git for about a year and would like to use tagging to, well, tag commits at different versions. I've found lots of info on the commands to use to work with tags, but what I'd like to know is why use tagging at all if I can just…

wufoo
- 13,571
- 12
- 53
- 78
139
votes
7 answers
Get the time and date of git tags
I have a project that is using git and have tagged all the releases with a tag.
$ git tag
v1.0.0
v1.0.1
v1.0.2
v1.0.3
v1.1.0
My goal is to list the releases and release dates in a web interface (tag/commit date = release date). Currently we list…

HNygard
- 4,526
- 6
- 32
- 40
137
votes
8 answers
Git Tag list, display commit sha1 hashes
so the git tag command lists the current git tags
tag1
tag2
git tag -n prints tag's message
tag1 blah blah
tag2 blah blah
What's the best way to get the hash of tag1 & tag2 ?

Quang Van
- 11,475
- 12
- 57
- 61
118
votes
5 answers
How can I tell if a given git tag is annotated or lightweight?
I type git tag and it lists my current tags:
1.2.3
1.2.4
How can I determine which of these is annotated, and which is lightweight?

G. Sylvie Davies
- 5,049
- 3
- 21
- 30
104
votes
3 answers
What names are valid git tags?
I have got a error message while creating tag containing [ character:
fatal: '[' is not a valid tag name.
Question: are there any rules for tags in the git?

Aik
- 3,528
- 3
- 19
- 20
87
votes
8 answers
In git, how do I sync my tags against a remote server?
Is there a way to keep my local git tags in lockstep with a remote's tags? That is -- not only get new tags when created (as usual, when fetch-ing/pull-ing), but also prune tags no longer on a remote and also delete existing tags when someone else…

mlb
- 1,222
- 1
- 9
- 12
84
votes
4 answers
"git describe" ignores a tag
In the following lines:
$ git tag -n1
v1.8 Tagged the day before yesterday
v1.9 Tagged yesterday
v2.0 Tagged today
$ git describe
v1.9-500-ga6a8c67
$
Can anyone explain why the v2.0 tag is not used by "git describe", and how…

knipknap
- 5,934
- 7
- 39
- 43
79
votes
2 answers
Adding Tags to a Pull Request
I have a repo iontech/Anagen forked from agiliq/Anagen
I made a few commits to my fork and added a tag. Then I opened a Pull Request. This Pull Request includes only my commits.
How do I include the tag I've created into the Pull Request?
user1062640
78
votes
1 answer
git tag delete and re-add
On git hub I re-added the tag by doing:
git tag -d 12.15
git push origin :refs/tags/12.15
git tag -a 12.15 -m '12.15'
git push --tags
The tag is still referring to the old tag on github, but locally it is done right.
UPDATE: It seems github is…

Chris Muench
- 17,444
- 70
- 209
- 362
77
votes
7 answers
Get last git tag from a remote repo without cloning
How to get last tag from a (non checked-out) remote repo?
On my local copy I use describe
git describe --abbrev=0 --tags
But I cannot use describe with remote storage

fl00r
- 82,987
- 33
- 217
- 237
76
votes
7 answers
Git force push tag when the tag already exists on remote
I have a tag already pushed onto the remote. When another user creates the same tag and tries to push, the push will fail because the tag already exists on the remote.
But I thought if I did --f force tag push, it should work. But that is not what I…

user3606175
- 2,013
- 1
- 13
- 16
71
votes
3 answers
Git tag before or after merge?
I have a simple question about tagging different versions of my project with git. If I just completed my 1.1 branch and plan to merge it into master, should I tag this branch as 1.1 before I merge it, or should I merge it to master and then tag it…

user1699176
- 813
- 1
- 6
- 5
67
votes
3 answers
Understanding Gitlab CI tags
I've read documentation, some articles and you might call me dumb, but this is my first time working with a concept like this.
I've registered runner with tag "testing"
created tag "testing" in gitlab
binded this runner, with particular project…

RiddleMeThis
- 817
- 1
- 6
- 10