Bird
0
0

If you run git config --global core.editor "nano -w", what will happen when you commit without a message?

medium📝 Command Output Q5 of 15
Git - Configuration and Aliases
If you run git config --global core.editor "nano -w", what will happen when you commit without a message?
AGit opens Nano editor with wrapping disabled for you to write the commit message
BGit throws an error because of incorrect syntax
CGit uses the default editor ignoring the setting
DGit opens Vim editor instead
Step-by-Step Solution
Solution:
  1. Step 1: Understand the command effect

    The command sets Nano with the -w option (disable wrapping) as the global editor for Git.
  2. Step 2: Predict behavior on commit without message

    When committing without a message, Git opens the configured editor to let you write the message. Here, Nano opens with wrapping disabled.
  3. Final Answer:

    Git opens Nano editor with wrapping disabled for you to write the commit message -> Option A
  4. Quick Check:

    core.editor with options opens editor as configured [OK]
Quick Trick: Add editor options inside quotes to pass flags [OK]
Common Mistakes:
  • Assuming syntax error due to quotes
  • Expecting default editor to override
  • Confusing Nano with Vim

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Git Quizzes