Last active
August 15, 2019 17:02
-
-
Save zerodevx/9f71a4530f70d4947747ad170c67cd25 to your computer and use it in GitHub Desktop.
Best practice to copy static website files from /build to /public correctly using rsync.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Works well for static sites - where tooling generates the distribution into a build directory, | |
# and you want to synchronise this with the public deployment directory. | |
# Add the --dry-run flag to perform a dry run. | |
cd <source> | |
rsync -rlpgoDci --del --exclude=.DS_Store . <destination> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
So that when you generate a
sitemap.xml
on/public
, the<lastmod>
of files are preserved. So Google knows not to reindex.