199k views
2 votes
How do you remove a tag from a commit?

A. git tag -d
B. git remove-tag
C. git tag -r
D. git delete

User Indrid
by
7.6k points

1 Answer

6 votes

Final answer:

To remove a tag from a commit in Git, use the command 'git tag -d TAGNAME', replacing 'TAGNAME' with the actual tag name, and then push the deletion to a remote repository if needed.

Step-by-step explanation:

The question pertains to the version control system Git, specifically on how to remove a tag from a commit. Among the options given, the correct command to remove a tag is git tag -d TAGNAME, where TAGNAME is the name of the tag you want to delete. Here's an example of its usage:

git tag -d v1.0.0

This command will delete the tag 'v1.0.0' from your local repository. If you wish to remove the tag from a remote repository, you'd first remove it locally with the above command, then push the deletion to the remote with:

git push origin :refs/tags/v1.0.0

It is important to note that option B, C, and D are not valid Git commands.

User Aabaz
by
7.6k points