Skip to content

Instantly share code, notes, and snippets.

@anuraghazra
Last active January 9, 2024 20:00
Show Gist options
  • Save anuraghazra/95a4150789f6166f75ff566b494c72d9 to your computer and use it in GitHub Desktop.
Save anuraghazra/95a4150789f6166f75ff566b494c72d9 to your computer and use it in GitHub Desktop.
Exclude node_modules folder when copying directory.

Handy Trick To Get Rid Of node_modules

This one is a simple and handy trick when you want to copy your directories without node_modules folder.

Enter this command in your terminal.

robocopy SOURCE DEST /mir /xd node_modules
@nitinja
Copy link

nitinja commented Jan 9, 2024

Hi!

For OSX (and i guess other unix)

rsync -av -progress --exclude="node_modules" sourceToCopy destination

Excellent, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment