Bird
0
0

What happens when you run git tag -a v1.0 abc123 -m "Release 1.0"?

easy📝 Conceptual Q1 of 15
Git - Tagging
What happens when you run git tag -a v1.0 abc123 -m "Release 1.0"?
ADeletes the tag <code>v1.0</code> from commit <code>abc123</code>
BCreates an annotated tag named <code>v1.0</code> on commit <code>abc123</code> with the message "Release 1.0"
CCreates a lightweight tag named <code>v1.0</code> on the current HEAD
DUpdates the commit message of <code>abc123</code> to "Release 1.0"
Step-by-Step Solution
Solution:
  1. Step 1: Understand the command

    git tag -a v1.0 abc123 -m "Release 1.0" creates an annotated tag named v1.0 on the commit with hash abc123 and attaches the message "Release 1.0".
  2. Step 2: Annotated vs Lightweight

    The -a flag specifies an annotated tag, which stores extra metadata including the message.
  3. Final Answer:

    Creates an annotated tag named v1.0 on commit abc123 with the message "Release 1.0" -> Option B
  4. Quick Check:

    Annotated tag creation confirmed [OK]
Quick Trick: Use -a and -m for annotated tags on specific commits [OK]
Common Mistakes:
  • Confusing annotated and lightweight tags
  • Assuming the tag is created on HEAD if commit hash is given
  • Thinking the command modifies commit messages

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Git Quizzes