0
0
Gitdevops~20 mins

Creating tags in Git - Practice Exercises

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Tag Mastery Badge
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate
2:00remaining
Output of creating an annotated tag
What is the output of running the following command in a Git repository?
git tag -a v1.0 -m "Release version 1.0"
Git
git tag -a v1.0 -m "Release version 1.0"
ACreates an annotated tag named v1.0 with the message 'Release version 1.0' and no output is shown
BCreates a lightweight tag named v1.0 and outputs 'Tag v1.0 created'
CCreates an annotated tag named v1.0 and outputs 'Annotated tag v1.0 created with message Release version 1.0'
DThrows an error because the -m option is invalid with -a
Attempts:
2 left
💡 Hint
Annotated tags store extra information like messages but do not print output by default.
🧠 Conceptual
intermediate
2:00remaining
Difference between lightweight and annotated tags
Which statement correctly describes the difference between lightweight and annotated tags in Git?
ALightweight tags are simple pointers to commits; annotated tags store extra metadata like author, date, and message
BAnnotated tags are pointers to branches; lightweight tags store commit messages
CLightweight tags can only be created locally; annotated tags are automatically pushed to remote
DAnnotated tags are temporary and deleted after checkout; lightweight tags are permanent
Attempts:
2 left
💡 Hint
Think about what extra information annotated tags hold compared to lightweight tags.
🔀 Workflow
advanced
2:30remaining
Correct sequence to create and push an annotated tag
What is the correct order of commands to create an annotated tag named v2.0 with message 'Second release' and push it to the remote repository?
A4, 1, 3, 2
B1, 4, 2, 3
C1, 2, 4, 3
D4, 1, 2, 3
Attempts:
2 left
💡 Hint
You must be on the correct branch before tagging, then push the tag, then update local info.
Troubleshoot
advanced
2:00remaining
Error when pushing tags to remote
You created a tag locally using git tag v3.0 but when you run git push, the tag does not appear on the remote. What is the reason?
AThe tag name v3.0 is invalid and rejected by the remote
BTags are not pushed by default with 'git push'; you must explicitly push tags
CYou need to delete the tag locally and recreate it as annotated to push
DThe remote repository does not support tags
Attempts:
2 left
💡 Hint
Think about how Git handles tags during push operations.
Best Practice
expert
3:00remaining
Recommended practice for tagging releases in a team
Which practice is best when multiple developers create tags for releases in a shared Git repository?
AUse only lightweight tags locally and convert them to annotated tags on the remote
BEach developer creates tags locally and never pushes them to avoid conflicts
CAgree on a naming convention and push tags to remote immediately after creation
DAvoid using tags and rely only on branch names for releases
Attempts:
2 left
💡 Hint
Think about coordination and clarity in a team environment.