Bird
0
0

What will be the output of git config user.name if you have set user.name globally but not locally?

medium📝 Command Output Q5 of 15
Git - Configuration and Aliases
What will be the output of git config user.name if you have set user.name globally but not locally?
AThe global user.name value is displayed
BAn error saying user.name is not set
CAn empty line with no output
DThe local user.name value is displayed
Step-by-Step Solution
Solution:
  1. Step 1: Understand Git config precedence

    Git checks local config first, then global if local is missing.
  2. Step 2: Predict output when only global is set

    Since local user.name is not set, Git returns the global user.name value.
  3. Final Answer:

    The global user.name value is displayed -> Option A
  4. Quick Check:

    Global config used if local missing [OK]
Quick Trick: Local config overrides global; else global used [OK]
Common Mistakes:
  • Expecting error if local missing
  • Thinking output is empty
  • Confusing local and global values

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Git Quizzes