The Git documentation says of text=auto
(emphasis added):
When
text
is set to"auto"
, Git decides by itself whether the file is text or binary. If it is text and the file was not already in Git with CRLF endings, line endings are converted on checkin and checkout as described above. Otherwise, no conversion is done on checkin or checkout.
But I don't see an explanation of how Git makes this decision.
How does Git decide if a file is text or binary? Is the algorithm documented somewhere? Is it substantially different across Git versions?