Bird
0
0

Given the following Git commands executed in order:

medium📝 Formula Result Q4 of 15
PCB Design - Design Review and Testing
Given the following Git commands executed in order:
git init
git add board.kicad_pcb
git commit -m "Initial commit"
git branch dev
git checkout dev
git add board.kicad_pcb
git commit -m "Update dev version"

What is the current branch and commit count?
ABranch: master, Commits: 1
BBranch: master, Commits: 2
CBranch: dev, Commits: 1
DBranch: dev, Commits: 2
Step-by-Step Solution
Solution:
  1. Step 1: Trace branch creation and checkout

    After 'git branch dev' and 'git checkout dev', current branch is 'dev'.
  2. Step 2: Count commits

    One commit on master, then one commit on dev branch, total 2 commits in repo.
  3. Final Answer:

    Branch: dev, Commits: 2 -> Option D
  4. Quick Check:

    Current branch and commits = dev, 2 [OK]
Quick Trick: Checkout changes current branch; commits accumulate per branch [OK]
Common Mistakes:
MISTAKES
  • Assuming branch stays master after checkout
  • Counting commits only on master branch

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PCB Design Quizzes