Bird
0
0

What will be the output of this command inside a Git repo?

medium📝 Command Output Q5 of 15
Git - Configuration and Aliases
What will be the output of this command inside a Git repo?
git config --list --show-origin

Assuming user.name is set globally and locally with different values.
AShows both global and local user.name with file origins
BShows only local user.name
CShows no user.name at all
DShows only global user.name
Step-by-Step Solution
Solution:
  1. Step 1: Understand --list --show-origin

    This command lists all config entries with the file they come from.
  2. Step 2: Check behavior with duplicate keys

    Both global and local user.name entries appear, showing their source files.
  3. Final Answer:

    Shows both global and local user.name with file origins -> Option A
  4. Quick Check:

    --show-origin lists all configs with source files [OK]
Quick Trick: Use --show-origin to see all config sources [OK]
Common Mistakes:
  • Thinking only one user.name shows
  • Assuming no origin info is shown
  • Confusing --list with just reading one config

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Git Quizzes