Interview Prep/Git & GitHub/Conflicts, remotes, fetch, pull and push

How does Git handle line endings and what is `core.autocrlf`?

AdvancedConceptConflicts, remotes, fetch, pull and push
Answer

autocrlf=true converts CRLF to LF on commit and LF to CRLF on checkout (Windows), input converts only on commit. A committed .gitattributes with * text=auto eol=lf is more reliable because it applies to everyone regardless of local config. Mixed endings produce whole-file diffs and phantom conflicts.

git add --renormalize .
All Git & GitHub questions Roadmap: Git & GitHub

More on Conflicts, remotes, fetch, pull and push