Exclude patterns
🛡️
Protect files from being overwritten.
A setting to keep files and folders out of the deployment, with both deployment strategies.
Exclude patterns work with both deployment strategies. An excluded file or folder is not copied from the deploy package, and what exists under that path on the web storage stays as it is. With the merge strategy this keeps build leftovers like node_modules out of the web storage. With the replace strategy, which deletes everything else first, it is also what preserves user uploads, assets, and other runtime data across deployments. Generally, exclude runtime data: files and folders created by the application, not tracked in Git. This typically includes user uploads, logs, and sessions.
When the repository contains a deploy file, this setting is managed there and cannot be edited in the dashboard.
Sensible defaults based on software templates are provided.
Rsync syntax is supported, allowing regex like patterns. The asterisk * serves as a wildcard. Patterns are matched starting from the Git source directory.
Examples
## WordPress
/wp-content
## Laravel
/storage
## Kirby CMS (if using git + rsync)
/content
/media
## Wildcard (rsync regex) syntax
*/files
## Exclude files from the final build
/node_modules
One setting, two use cases
- Exclude from deployment: Prevent files from being copied to the environment. Works with both strategies.
- Useful for files that are only needed during the build.
node_modulesis the common case, and the software templates set it.
- Preserve on environment: Prevent files from being deleted by the replace strategy.
- Essential for runtime data created by the application.
- Example: User uploads, content files, and logs.
Related
With the merge strategy, replace patterns do the reverse: they name folders that are swapped completely while everything else is kept.