Git 如何在Ubuntu 10.10上跳过tar中的文件

Git 如何在Ubuntu 10.10上跳过tar中的文件,git,tar,Git,Tar,我想做的是将我的git主分支和管道归档到tar,但排除一些文件类型和目录。然后,此tar文件将被卸载到我的web目录。只需运行git归档,然后使用常规tar操作编写删除文件的脚本。您可以提供要归档的路径列表 git archive -o /tmp/archive.tar -- html/ images/ css/ index.htm 或者您可以重用git ls文件 git ls-files -z | xargs -z git archive -o /tmp/archive.tar --

我想做的是将我的git主分支和管道归档到tar,但排除一些文件类型和目录。然后,此tar文件将被卸载到我的web目录。

只需运行git归档,然后使用常规tar操作编写删除文件的脚本。

您可以提供要归档的路径列表

 git archive -o /tmp/archive.tar -- html/ images/ css/ index.htm
或者您可以重用git ls文件

 git ls-files -z | xargs -z git archive -o /tmp/archive.tar --

git ls files具有排除文件的选项(可以选择使用类似于per directoty.gitignore文件的customg exclude files)
mangitls文件

git存档-o xyz.tar?