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
0 views
Back to Blog

Related posts

Read more »

Ghostty – Terminal Emulator

Article Ghostty – Terminal Emulatorhttps://ghostty.org/docs Discussion - Comments: Hacker News threadhttps://news.ycombinator.com/item?id=47206009 – 411 points...

Neovim translate popup

markdown !Cover image for Neovim translate popuphttps://media2.dev.to/dynamic/image/width=1000,height=420,fit=cover,gravity=auto,format=auto/https%3A%2F%2Fdev-t...