Useful command when moving source code to a new folder or repository - sync files
Published: (February 26, 2026 at 03:08 AM EST)
1 min read
Source: Dev.to
Source: Dev.to
Useful command when moving source code to a new folder or repository
It can update, create, and delete files.
rsync -av --exclude={'node_modules','.git','logs'} --exclude-from='.gitignore' ./ /path/to/destination
Explanation
rsync: sync files from one folder to another--exclude={'node_modules','.git','logs'}: exclude some folders--exclude-from='.gitignore': exclude files listed in.gitignore./: current folder/path/to/destination: destination folder