Bird
0
0

Which of the following commands correctly tags a commit with hash abc123 as v1.0?

easy📝 Syntax Q12 of 15
Git - Tagging
Which of the following commands correctly tags a commit with hash abc123 as v1.0?
Agit tag -m v1.0 abc123
Bgit tag abc123 v1.0
Cgit tag v1.0 abc123
Dgit commit tag v1.0 abc123
Step-by-Step Solution
Solution:
  1. Step 1: Recall git tag syntax

    The correct syntax to tag a specific commit is git tag <tagname> <commit-hash>.
  2. Step 2: Match syntax with options

    git tag v1.0 abc123 matches the correct order: tag name first, then commit hash. Others have wrong order or invalid flags.
  3. Final Answer:

    git tag v1.0 abc123 -> Option C
  4. Quick Check:

    git tag <tag> <commit> [OK]
Quick Trick: Tag name comes before commit hash in command [OK]
Common Mistakes:
  • Swapping tag name and commit hash
  • Using git commit instead of git tag
  • Adding wrong flags like -m without message

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Git Quizzes