Exclusions
Exclude files and directories from HostnExtra Sync operations.
Exclusions
HostnExtra Sync supports excluding files and directories from synchronization using the --exclude option.
Basic Usage
hostnextra sync push ./build \
--to web-prod-01:/var/www \
--exclude node_modulesMultiple Exclusions
Multiple exclusion patterns can be provided as a comma-separated list.
hostnextra sync push ./build \
--to web-prod-01:/var/www \
--exclude node_modules,.gitFor example, this excludes:
node_modules
.gitfrom the synchronization.
Common Examples
Exclude development dependencies:
hostnextra sync push ./build \
--to web-prod-01:/var/www \
--exclude node_modulesExclude Git metadata:
hostnextra sync push ./build \
--to web-prod-01:/var/www \
--exclude .gitExclude multiple directories:
hostnextra sync push ./build \
--to web-prod-01:/var/www \
--exclude node_modules,.git,.cacheExclusions and --delete
Exclusions also matter when using --delete.
Before performing a destructive synchronization, use a dry run to verify the resulting changes:
hostnextra sync push ./build \
--to web-prod-01:/var/www \
--exclude node_modules,.git \
--delete \
--dry-runThis lets you inspect the planned synchronization before making changes.