0
0
Gitdevops~20 mins

Global vs local configuration in Git - Practice Questions

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Git Config Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding Git Configuration Levels

Which Git configuration level applies settings only to the current repository?

ALocal configuration
BGlobal configuration
CSystem configuration
DEnvironment configuration
Attempts:
2 left
💡 Hint

Think about where you want the settings to take effect: just one project or all projects on your computer.

💻 Command Output
intermediate
2:00remaining
Output of Git Config List Command

What is the output of the command git config --list --local when run inside a repository with a user.email set locally?

Auser.email=system@example.com
Buser.email=global@example.com
CNo output, command fails
Duser.email=local@example.com
Attempts:
2 left
💡 Hint

Local config overrides global and system for that repository.

🔀 Workflow
advanced
2:00remaining
Setting User Name for All Repositories

You want to set your Git user name for all repositories on your computer. Which command should you run?

Agit config --global user.name "Alice"
Bgit config --local user.name "Alice"
Cgit config --system user.name "Alice"
Dgit config user.name "Alice"
Attempts:
2 left
💡 Hint

Think about which config level applies to all repositories for your user.

Troubleshoot
advanced
2:00remaining
Why Does Git Use the Wrong Email?

You set your email globally with git config --global user.email "global@example.com", but commits in one repository still use a different email. What is the most likely reason?

AThe email is set in the environment variables and overrides Git config
BThe system configuration overrides the global setting
CThe repository has a local user.email set that overrides the global setting
DGit caches the email and needs to be restarted
Attempts:
2 left
💡 Hint

Remember the order of precedence for Git config levels.

Best Practice
expert
2:00remaining
Choosing Git Config Level for Machine-wide Settings

Which Git configuration level should you use to set a proxy for all users on a shared machine?

AGlobal configuration
BSystem configuration
CLocal configuration
DRepository configuration
Attempts:
2 left
💡 Hint

Think about settings that affect all users on the machine.