Skip to content

Instantly share code, notes, and snippets.

@Spike-Leung
Last active December 4, 2023 17:56
Show Gist options
  • Save Spike-Leung/8a752b31d6eea31ea36075f3b04865a5 to your computer and use it in GitHub Desktop.
Save Spike-Leung/8a752b31d6eea31ea36075f3b04865a5 to your computer and use it in GitHub Desktop.
zip

zip recursively and encrypt and ignore node_modules, .git and some other files

# exclude files should be full path to the files if PATH_TO_SOURCE_FILES is not the root path of exclude files
$ zip -re PATH_TO_TARGET PATH_TO_SOURCE_FILES  -x "node_modules/*" ".git/*"

# example
$ zip -re "$HOME/git/demo.zip" .  -x "node_modules/*" ".git/*" "test/*" ".husky/*"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment