Skip to content

Instantly share code, notes, and snippets.

@zxhfighter
Last active April 9, 2021 06:52
Show Gist options
  • Save zxhfighter/e5a9dda60b60ff104f359d0bd4a74cc9 to your computer and use it in GitHub Desktop.
Save zxhfighter/e5a9dda60b60ff104f359d0bd4a74cc9 to your computer and use it in GitHub Desktop.
using `--exclude` in tar command

Mac 下打包排除目录,--exclude 参数必须紧跟在 tar 命令后边,否则不会生效。

tar --exclude="*.pkg" --exclude=".git" --exclude="node_modules*" -cvzf weirwood-node.tar.gz weirwood-node/

tar --exclude="*.pkg" --exclude="dist" --exclude="upload-files"  --exclude="log" --exclude="upload-files-source" --exclude="sourcemap-cache" --exclude=".git" --exclude="node_modules*" -cvzf weirwood-node.tar.gz weirwood-node/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment