Exclude patterns

🛡️

Protect files from being overwritten.

A setting to define files and folders not be replaced during deployment with replace strategy.

This is essential to preserve user uploads, assets, and other user-generated content. This setting is only available when the deployment strategy is set to 'replace'. Note that with the replace strategy, all files from the deployment build will replace the content of the actual web storage. Generally, you want to exclude runtime data (files and folder created by the website not with git). Usually this about user uploads, logs, sessions.

Sensible defaults based on software templates are provided.

Rsync syntax is supported, allowing regex like patterns. The asterisk * serves as a wildcard.

# Examples

## WordPress
/wp-content

## Laravel
/storage

## Kirby CMS (if using git + rsync)
/content
/media

## Wildcard (rsync regex) syntax
*/files

## Exclude things to show up in final build
/node_modules
yml

# One setting, two use cases

  • Exclude from deployment: Prevent files from being copied to the environment.
    • Useful for files that are only needed during deployment.
    • node_modules are often excluded to keep the runtime clean.
  • Preserve on environment: Prevent files from being overwritten or deleted.
    • Essential for runtime data created by the application.
    • Example: User uploads, content files, and logs.

When the deployment strategy is set to blend, there is an opposite setting to define replace patterns.

Found a tpyo?Edit