Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in DevOps and Agile by (29.3k points)

I created a tag on the master branch called v0.1 like this:

git tag -a v0.1

But then I realized there were still some changes I needed to merge into master for release 0.1, so I did that. But now my v0.1 tag is stuck on (to invoke the post-it note analogy) the wrong commit. I want it to be stuck on the most recent commit on master, but instead, it is stuck on the second most recent commit on master.

How can I move it to the most recent commit on master?

1 Answer

0 votes
by (50.2k points)

For Updating an existing tag use the following command

git tag -a -f v1.4 <commit id>

Executing the above command will map the commit to the v1.4 tag identifier. It will override any existing content for the v1.4 tag.

-f option must be used to move a tag on a git branch to a different commit.

Browse Categories

...