Steven Engelhardt
  • About Me
  • Blog
  • Links
  • Post Series
  • Projects
  • Subscribe
Practical Bazel: Force Line Endings to LF
Practical Bazel bazel cross-platform windows linux
Published: 2020-10-29
Practical Bazel: Force Line Endings to LF

Bazel requires all files to end with LF (not CR-LF) in order to work correctly.

If you are performing cross-platform Bazel development with Windows users, you can force this setting for all text files in your repo by creating a .gitattributes file with the following content:

# Force unix-style linefeeds.
* text=auto eol=lf
  • © Steven Engelhardt 2004 — 2026
  • GitHub
  • LinkedIn