From 1ee260915088d97f1cfa9b089ce17e9ea721db1f Mon Sep 17 00:00:00 2001 From: Gary Jones Date: Mon, 24 Jul 2023 15:21:30 +0100 Subject: [PATCH] Add .gitattributes file This removes development files and folders from release archives, and makes them unavailable when using Composer with `--prefer-dist`. --- .gitattributes | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..3bac74db --- /dev/null +++ b/.gitattributes @@ -0,0 +1,29 @@ +# Exclude these files from release archives. +# This will also make them unavailable when using Composer with `--prefer-dist`. +# If you develop for CAP using Composer, use `--prefer-source`. +# https://blog.madewithlove.be/post/gitattributes/ + +/.github/ export-ignore +/bin/ export-ignore +/src/__mocks__/ export-ignore +/src/__tests__/ export-ignore +/tests/ export-ignore +/.distignore export-ignore +/.editorconfig export-ignore +/.gitattributes export-ignore +/.gitignore export-ignore +/.phpcs.xml.dist export-ignore +/phpunit.xml.dist export-ignore +/CHANGELOG.md export-ignore +/phpunit.xml.dist export-ignore + +# Auto detect text files and perform LF normalization +# https://pablorsk.medium.com/be-a-git-ninja-the-gitattributes-file-e58c07c9e915 + +* text=auto + +# The above will handle all files NOT found below + +*.md text +*.php text +*.inc text