Challenge - 5 Problems
Editor Configuration Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate1:30remaining
What is the output of setting core.editor to nano?
You run the command
git config --global core.editor nano. What will be the output of git config --global core.editor after this?Git
git config --global core.editor nano git config --global core.editor
Attempts:
2 left
💡 Hint
The core.editor setting defines the default editor Git uses for commit messages.
✗ Incorrect
Setting core.editor to nano means Git will use nano as the default editor. Querying the setting returns 'nano'.
🧠 Conceptual
intermediate1:30remaining
Which Git config scope affects only the current repository?
Git has three config scopes: system, global, and local. Which scope applies settings only to the current repository?
Attempts:
2 left
💡 Hint
Think about where Git stores config files for each scope.
✗ Incorrect
The local scope stores config in the .git/config file inside the repository, affecting only that repo.
❓ Configuration
advanced2:00remaining
How to configure Vim as Git's default editor with line numbers enabled?
You want Git to use Vim as the default editor and show line numbers when editing commit messages. Which command correctly sets this?
Attempts:
2 left
💡 Hint
Vim accepts commands with the -c option to run on start.
✗ Incorrect
The command 'vim -c ':set number'' tells Vim to start and execute ':set number' to enable line numbers.
❓ Troubleshoot
advanced2:00remaining
Why does Git fail to open the editor after setting core.editor to a non-existent program?
You set
git config --global core.editor myfakeeditor but Git fails to open the editor when committing. What is the likely cause?Attempts:
2 left
💡 Hint
Git tries to run the editor command exactly as configured.
✗ Incorrect
If the editor command is not found in the system PATH, Git cannot launch it and fails.
✅ Best Practice
expert2:30remaining
What is the best practice to set a GUI editor like VS Code as Git's default editor on all systems?
You want to configure Git to use Visual Studio Code as the default editor across different operating systems. Which command is best?
Attempts:
2 left
💡 Hint
Git waits for the editor to close before continuing.
✗ Incorrect
The '--wait' flag tells VS Code to stay open until the file is closed, so Git waits properly for the commit message.