Bird
0
0

How can you configure Git to automatically convert line endings to LF on commit and back to CRLF on checkout for Windows users?

hard📝 Application Q9 of 15
Git - Configuration and Aliases
How can you configure Git to automatically convert line endings to LF on commit and back to CRLF on checkout for Windows users?
ASet core.autocrlf to false globally
BSet core.autocrlf to true globally
CSet core.safecrlf to false locally
DSet core.eol to crlf globally
Step-by-Step Solution
Solution:
  1. Step 1: Understand core.autocrlf purpose

    Setting core.autocrlf to true converts CRLF to LF on commit and LF to CRLF on checkout, fixing line ending issues on Windows.
  2. Step 2: Recognize correct global setting for Windows users

    Setting this globally ensures consistent behavior across all repos on the machine.
  3. Final Answer:

    Set core.autocrlf to true globally -> Option B
  4. Quick Check:

    core.autocrlf=true fixes Windows line endings [OK]
Quick Trick: Use core.autocrlf=true on Windows [OK]
Common Mistakes:
  • Setting core.autocrlf to false disables conversion
  • Confusing core.safecrlf with autocrlf
  • Setting core.eol incorrectly

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Git Quizzes