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 忽略多個目錄


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM