Git - Configuration and AliasesHow 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 globallyBSet core.autocrlf to true globallyCSet core.safecrlf to false locallyDSet core.eol to crlf globallyCheck Answer
Step-by-Step SolutionSolution:Step 1: Understand core.autocrlf purposeSetting core.autocrlf to true converts CRLF to LF on commit and LF to CRLF on checkout, fixing line ending issues on Windows.Step 2: Recognize correct global setting for Windows usersSetting this globally ensures consistent behavior across all repos on the machine.Final Answer:Set core.autocrlf to true globally -> Option BQuick 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 conversionConfusing core.safecrlf with autocrlfSetting core.eol incorrectly
Master "Configuration and Aliases" in Git9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More Git Quizzes Collaboration Workflows - Handling PR feedback and updates - Quiz 1easy Git Configuration and Aliases - Editor configuration - Quiz 15hard Rebasing - Editing commit messages with rebase - Quiz 3easy Rebasing - When to rebase vs when to merge - Quiz 9hard Remote Repositories - Fetch vs pull difference - Quiz 11easy Remote Repositories - Why remotes enable collaboration - Quiz 9hard Remote Repositories - Deleting remote branches - Quiz 14medium Stashing - Why stashing saves work temporarily - Quiz 2easy Tagging - Lightweight vs annotated tags - Quiz 4medium Tagging - Listing tags - Quiz 9hard