1
0
Fork 0

Revert "Remove docs about light-weight packages"

This reverts commit b34220edc8.
pull/11795/head
Jordi Boggiano 2024-03-19 15:23:35 +01:00
parent 504e6c581a
commit 83212118cb
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 30 additions and 0 deletions

View File

@ -150,4 +150,34 @@ allows you to submit the URL to your VCS repository, at which point Packagist
will start crawling it. Once it is done, your package will be available to will start crawling it. Once it is done, your package will be available to
anyone! anyone!
## Light-weight distribution packages
Some useless information like the `.github` directory, or large examples, test
data, etc. should typically not be included in distributed packages.
The `.gitattributes` file is a git specific file like `.gitignore` also living
at the root directory of your library. It overrides local and global
configuration (`.git/config` and `~/.gitconfig` respectively) when present and
tracked by git.
Use `.gitattributes` to prevent unwanted files from bloating the zip
distribution packages.
```text
// .gitattributes
/demo export-ignore
phpunit.xml.dist export-ignore
/.github/ export-ignore
```
Test it by inspecting the zip file generated manually:
```shell
git archive branchName --format zip -o file.zip
```
> **Note:** Files would be still tracked by git just not included in the
> zip distribution. This only works for packages installed from
> dist (i.e. tagged releases) coming from GitHub, GitLab or Bitbucket.
← [Basic usage](01-basic-usage.md) | [Command-line interface](03-cli.md) → ← [Basic usage](01-basic-usage.md) | [Command-line interface](03-cli.md) →