Is there a way to enforce core.autocrlf=input
from within the .gitattributes
in order to propagate the policy throughout my colleagues?
In deta
The closest thing to core.autocrlf=input
is to use text=auto
in .gitattributes.
That specifies they are text files, so new files will be put in the repo with LF line endings.
And, according to The gitattributes documentation, by setting text=auto
:
When the file has been committed with CRLF, no conversion is done.
We converted a Mercurial repo to Git recently. Mercurial does no eol conversions, so many of our files already had CRLF after the conversion. Setting text=auto
for those file extensions allows new files to still be normalized to LF, but doesn't touch the existing files, and doesn't show them as modified in the current directory.