Challenge - 5 Problems
Tag Deletion Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate2:00remaining
Deleting a local Git tag
What is the output of the command when deleting a local tag named
v1.0?Git
git tag -d v1.0
Attempts:
2 left
💡 Hint
Deleting a local tag shows confirmation with the tag name and commit hash.
✗ Incorrect
The command
git tag -d v1.0 deletes the local tag and confirms with the tag name and commit hash. If the tag does not exist, it shows an error. Deleting a branch uses a different command.💻 Command Output
intermediate2:00remaining
Deleting a remote Git tag
What is the output of the command when deleting a remote tag named
release from origin?Git
git push origin --delete releaseAttempts:
2 left
💡 Hint
Deleting a remote tag uses
git push origin --delete <tagname> and shows deletion confirmation.✗ Incorrect
The command deletes the remote tag and confirms with the remote name and deleted tag. Errors occur if the remote is missing or the command syntax is wrong.
❓ Troubleshoot
advanced2:00remaining
Why does deleting a remote tag fail?
You run
git push origin --delete v2.0 but get the error error: unable to delete 'v2.0': remote ref does not exist. What is the most likely cause?Attempts:
2 left
💡 Hint
Check if the tag exists on the remote before deleting.
✗ Incorrect
The error means the remote does not have the tag 'v2.0'. Permissions or remote config errors produce different messages. Local tag presence does not affect remote deletion.
✅ Best Practice
advanced2:00remaining
Recommended workflow to delete a tag both locally and remotely
Which sequence of commands correctly deletes a tag named
hotfix both locally and on the remote named origin?Attempts:
2 left
💡 Hint
Delete local tag first, then delete remote tag with --delete option.
✗ Incorrect
The recommended way is to delete the local tag first with 'git tag -d' then delete the remote tag with 'git push origin --delete hotfix'. Using refspec syntax is less clear.
🧠 Conceptual
expert2:00remaining
Understanding the effect of deleting tags on collaborators
After deleting a remote tag
v3.0 with git push origin --delete v3.0, what must collaborators do to remove the tag from their local repositories?Attempts:
2 left
💡 Hint
Local tags are not deleted automatically; pruning is required.
✗ Incorrect
Deleting a remote tag does not remove it from local clones automatically. Collaborators must prune remote-tracking tags with 'git fetch --prune origin' and delete local tags manually if needed.