diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 000000000..9ce0f35fa
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,5 @@
+# Set the default behavior, in case people don't have core.autocrlf set.
+* text=auto
+
+# Ensure diffs have LF endings
+*.diff text eol=lf