Take the 2-minute tour ×

After renaming a git tag "1.0" to "1.5" with

git tag 1.5 1.0
git tag -d 1.0
git push origin :refs/tags/1.0

my git repository seems to be in an inconsistent state. Here is the git describe output:

warning: tag '1.0' is really '1.5' here

it should return 1.5-... now

the git fsck --tags output:

tagged commit aad9477bba4bcf44ea34ea9693aeffc98527ff01 (1.0) in b96ce67583239e198f9e2aff5175176d65779044
Checking objects: 100% (3975/3975), done.

How can I remove the dangling reference to the deleted tag? Is this the right way for renaming tags?

share|improve this question
Honestly, I tried and tried but couldn't reproduce your dangling tag. Your procedure at the top seems to be a standard way to rename tags, and it worked for me. –  Mike Monkiewicz Jan 22 '13 at 20:55
add comment

2 Answers

To reiterate the standard caution whenever someone suggests rewriting history (or in this instance, retagging history) -- if you can avoid it, don't do it.

However, there are times it just isn't worth the long-term pain of an inaccurate (messy) history and the short-term pain is worth it.

If that is the case, the following article gives the steps needed: How to Rename a Tag Already Pushed to a Remote git Repo.

Basic steps are:

git tag new_tag old_tag
git push --tags
git push origin :refs/tags/old_tag
git tag -d old_tag
share|improve this answer
Is here a way to remove a "1.0" tag completely from the git history in my case? –  Artjom Jan 19 '13 at 15:01
add comment

No, I don't think this is the proper workflow for tags in git.

A fundamental rule of git is: Don't mess with something you've already pushed.

Since you've already pushed tag 1.0, you do not want to be renaming it to 1.5 locally and then trying to push it. Leave the 1.0 tag for posterity, create a new 1.5 tag, and push that, too. And really- that's what tags are for. So you can go back 6 months from now and recreate what your software was like at version 1.0.

share|improve this answer
Well, the initial commit was tagged with "1.0" but actually it should be tagged as "1.5". Therefore my attempt to rename it. –  Artjom Jan 17 '13 at 16:08
add comment

Your Answer


