How do we keep GitLab's web editor from switching line endings?

Problem to solve

Someone recently contributed a change using GitLab’s web editor, which changed all of the line endings in the affected file from LF to CRLF:

Is there a way to keep this from happening, e.g. via .gitattributes or via the project config?

Versions

Please add an x whether options apply, and add the version information.

  • Self-managed
  • GitLab.com SaaS
  • Dedicated
2 Likes