Bird
0
0

Given these commands run inside a Git repo:

medium📝 Command Output Q4 of 15
Git - Configuration and Aliases
Given these commands run inside a Git repo:
git config --global user.email "global@example.com"
git config user.email "local@example.com"
git config user.email

What is the output of the last command?
Alocal@example.com
Bglobal@example.com
CNo output, error
DBoth emails printed
Step-by-Step Solution
Solution:
  1. Step 1: Understand config precedence

    Local config overrides global config for the same key inside a repo.
  2. Step 2: Check the last command output

    git config user.email without flags shows local config if set, so it prints "local@example.com".
  3. Final Answer:

    local@example.com -> Option A
  4. Quick Check:

    Local config overrides global inside repo [OK]
Quick Trick: Local config overrides global inside a repo [OK]
Common Mistakes:
  • Expecting global config to show instead
  • Thinking command prints both values
  • Assuming error if local exists

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Git Quizzes