zl程序教程

您现在的位置是:首页 >  系统

当前栏目

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

Linux文件Gitzip 文件夹 压缩 tar 忽略
2023-09-11 14:20:09 时间
  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 忽略多个目录