Challenge - 5 Problems
Git Tagging Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate2:00remaining
What is the output of this git tag command?
You run the command
git tag -a v1.0 9fceb02 -m "Release version 1.0". What does this command do?Git
git tag -a v1.0 9fceb02 -m "Release version 1.0"
Attempts:
2 left
💡 Hint
The '-a' option creates an annotated tag, and '-m' adds a message.
✗ Incorrect
The command creates an annotated tag named 'v1.0' on the specific commit '9fceb02'. The '-a' flag means annotated tag, and '-m' adds the tag message.
🧠 Conceptual
intermediate1:30remaining
Which git command shows the commit a tag points to?
You want to see the commit hash that a tag named 'v2.0' points to. Which command will show this?
Attempts:
2 left
💡 Hint
One command shows tag details including the commit.
✗ Incorrect
git show v2.0 displays the commit and tag details for the tag 'v2.0'.
❓ Troubleshoot
advanced2:00remaining
Why does this tag command fail?
You run
git tag -a v3.0 abc1234 -m "Version 3.0" but get an error: fatal: Not a valid object name abc1234. What is the likely cause?Git
git tag -a v3.0 abc1234 -m "Version 3.0"
Attempts:
2 left
💡 Hint
Check if the commit hash exists in your repo.
✗ Incorrect
The error means the commit hash 'abc1234' is not found. You must use a valid commit hash to tag.
🔀 Workflow
advanced1:30remaining
How to push a specific tag to remote?
You created a tag 'release-1.1' locally. Which command pushes only this tag to the remote repository?
Attempts:
2 left
💡 Hint
Pushing all tags uses a different flag.
✗ Incorrect
git push origin release-1.1 pushes only the specified tag to the remote.
✅ Best Practice
expert2:30remaining
What is the best practice for tagging a release commit?
You want to tag a release commit so that it includes metadata like author, date, and a message. Which tag type should you use?
Attempts:
2 left
💡 Hint
One tag type stores extra information and is recommended for releases.
✗ Incorrect
Annotated tags store metadata such as author, date, and a message. They are best for marking releases.