Replace patterns
Published
Updated
🔄
Which files get replaced.
With the merge strategy, a fortrabbit deployment keeps every file it does not overwrite. Replace patterns name the folders that are swapped completely instead, so deleted files do not pile up.
Replace patterns need the merge deployment strategy. Merge copies the deploy package over the storage and deletes nothing, so a file removed in Git stays in the storage. For a folder matched by a replace pattern, the deployment deletes the old content first.
When the repository contains a deploy file, this setting is managed there and cannot be edited in the dashboard.
The software template sets defaults, such as the project config folder of Craft CMS: a stale config file there would be applied again. Patterns follow rsync syntax: * matches any characters, a leading / anchors the pattern at the Git source directory.
Examples
## Craft CMS
/config/project
## Pattern to replace all JPGs
*.jpg
Exclude patterns
Exclude patterns are the counterpart: they keep files and folders out of the deployment. They work with both strategies.