Filter sources for the tarball. (#808)

diff --git a/.gitattributes b/.gitattributes
index a1665da..9a841cd 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1 +1,33 @@
 tests/testdata/* binary
+
+# Exclude everything
+**/** export-ignore
+
+# Add top-level files
+bootstrap !export-ignore
+BUILD !export-ignore
+CMakeLists.txt !export-ignore
+compiler_config_setting.bzl !export-ignore
+configure !export-ignore
+configure-cmake !export-ignore
+configure.ac !export-ignore
+CONTRIBUTING.md !export-ignore
+LICENSE !export-ignore
+Makefile !export-ignore
+Makefile.am !export-ignore
+MANIFEST.in !export-ignore
+premake5.lua !export-ignore
+README !export-ignore
+README.md !export-ignore
+WORKSPACE !export-ignore
+
+# Add sources
+c !export-ignore
+c/** !export-ignore
+c/common/dictionary.bin*  export-ignore
+c/fuzz export-ignore
+
+# Add man pages
+docs !export-ignore
+docs/** !export-ignore
+docs/brotli-comparison-study-2015-09-22.pdf export-ignore
\ No newline at end of file