gsutil rsync -r -d build/ gs://my-bucket/site/

Category: Google Cloud & Workspace

gsutil rsync -r -d build/ gs://my-bucket/site/

Mirror a local directory to a bucket

Makes the bucket's site/ prefix exactly match the local build/ folder, uploading new and changed files and removing objects that no longer exist locally. The -d flag deletes extras in the destination, so test with -n first to preview changes. Ideal for deploying static websites.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.