linux zip,tar压缩文件夹 忽略 .git 文件夾

  1. linux zip 忽略 .git 文件夾
# zip 命令
zip -r bitvolution.zip bitvolution -x *.git*

# tar命令压缩文件夹忽略 .git文件夹
tar -zcv --exclude='.git' --exclude='.gitignore' -f test.tar.gz ./*

zip 如果需要忽略多个目录

使用

zip -r test.zip test/ -x@exclude.lst

exclude.lst 文件 的内容是

*.git*


*/laravel/vendor/*
*/thinkphp/vendor/*
Refrences
  1. tar: --exclude=“.git”: Cannot stat: No such file or directory
  2. ssh 免密碼登錄 Linux使用ssh公钥实现免密码登录Linux
  3. ssh 配置跳板机
  4. ZIP 打包时过滤指定目录和文件 zip 忽略多个目录
posted @ 2019-07-28 17:25  五毛钱的饼  阅读(3926)  评论(0编辑  收藏  举报