git config --global core.autocrlf input

Category: Git - Core

git config --global core.autocrlf input

Convert CRLF line endings on commit

For Linux and macOS, the input setting converts CRLF endings to LF when committing while leaving the working tree alone. It keeps repositories consistent for teams mixing Windows and Unix. Windows users usually set true instead.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.