Challenge - 5 Problems
.gitconfig Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate1:30remaining
Understanding Sections in .gitconfig
Which section in a .gitconfig file is used to set the user's email address?
Attempts:
2 left
💡 Hint
Look for the section that stores user identity information.
✗ Incorrect
The [user] section in .gitconfig holds user-specific information like name and email.
💻 Command Output
intermediate2:00remaining
Output of git config --list
Given this .gitconfig snippet, what will be the output of 'git config --list'?
Git
[core] editor = vim [user] name = Alice email = alice@example.com
Attempts:
2 left
💡 Hint
git config --list shows all key=value pairs with section prefixes.
✗ Incorrect
The command lists all config entries with their full keys including section names.
❓ Configuration
advanced2:00remaining
Configuring Aliases in .gitconfig
Which .gitconfig snippet correctly defines an alias 'co' for 'checkout'?
Attempts:
2 left
💡 Hint
Aliases are defined under the [alias] section with key = value syntax.
✗ Incorrect
The [alias] section uses key = value pairs to define shortcuts for git commands.
❓ Troubleshoot
advanced2:00remaining
Identifying Syntax Error in .gitconfig
Which option contains a syntax error that will cause git to fail reading the .gitconfig file?
Attempts:
2 left
💡 Hint
Check for missing indentation after section headers.
✗ Incorrect
In option D, 'name = Bob' is not indented under [user], causing a syntax error.
✅ Best Practice
expert2:00remaining
Best Practice for Global vs Local .gitconfig
Where should you place user-specific settings like name and email to apply them to all repositories on your machine?
Attempts:
2 left
💡 Hint
Think about settings that apply to all projects for one user.
✗ Incorrect
Global .gitconfig in the home directory applies settings to all repos for that user.