0
0
Gitdevops~20 mins

Editor configuration in Git - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Editor Configuration Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate
1: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
Aemacs
Bvim
Cnano
Dcode
Attempts:
2 left
💡 Hint
The core.editor setting defines the default editor Git uses for commit messages.
🧠 Conceptual
intermediate
1: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?
Asystem
Bglobal
Cenvironment
Dlocal
Attempts:
2 left
💡 Hint
Think about where Git stores config files for each scope.
Configuration
advanced
2: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?
Agit config --global core.editor "vim -c ':set number'"
Bgit config --global core.editor "vim --number"
Cgit config --global core.editor "vim -n"
Dgit config --global core.editor "vim +set\ number"
Attempts:
2 left
💡 Hint
Vim accepts commands with the -c option to run on start.
Troubleshoot
advanced
2: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?
AGit requires core.editor to be set to 'vim' or 'nano' only
BThe program 'myfakeeditor' does not exist or is not in PATH
CThe global config file is corrupted
DGit does not support custom editors
Attempts:
2 left
💡 Hint
Git tries to run the editor command exactly as configured.
Best Practice
expert
2: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?
Agit config --global core.editor "code --wait"
Bgit config --global core.editor "code"
Cgit config --global core.editor "code -w"
Dgit config --global core.editor "code --no-wait"
Attempts:
2 left
💡 Hint
Git waits for the editor to close before continuing.