0
0
Gitdevops~20 mins

Deleting tags in Git - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Tag Deletion Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate
2: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
ADeleted branch 'v1.0' (was 9fceb02)
Berror: tag 'v1.0' not found.
CDeleted tag 'v1.0' (was 9fceb02)
Dfatal: not a git repository (or any of the parent directories): .git
Attempts:
2 left
💡 Hint
Deleting a local tag shows confirmation with the tag name and commit hash.
💻 Command Output
intermediate
2: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 release
Aerror: unknown option `--delete tag'
B
To origin
 - [deleted]         release
Cfatal: remote origin not found.
DDeleted tag 'release' locally
Attempts:
2 left
💡 Hint
Deleting a remote tag uses git push origin --delete <tagname> and shows deletion confirmation.
Troubleshoot
advanced
2: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?
AThe remote 'origin' is not configured.
BYou do not have permission to delete tags on the remote.
CThe local tag 'v2.0' is missing.
DThe tag 'v2.0' does not exist on the remote repository.
Attempts:
2 left
💡 Hint
Check if the tag exists on the remote before deleting.
Best Practice
advanced
2: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?
Agit tag -d hotfix && git push origin --delete hotfix
Bgit tag -d hotfix && git push origin :refs/tags/hotfix
Cgit push origin --delete hotfix && git tag -d hotfix
Dgit push origin :refs/tags/hotfix && git tag -d hotfix
Attempts:
2 left
💡 Hint
Delete local tag first, then delete remote tag with --delete option.
🧠 Conceptual
expert
2: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?
ARun <code>git fetch --prune origin</code> to update and remove deleted remote tags locally.
BRun <code>git tag -d v3.0</code> only; no fetch needed.
CRun <code>git pull</code> to automatically delete the tag locally.
DNo action needed; tags are deleted automatically on fetch.
Attempts:
2 left
💡 Hint
Local tags are not deleted automatically; pruning is required.