在用 git archive 打包时排除指定的文件(夹)
git archive 命令默认在打包时会包含当前提交中所有的文件(不包含.git)。
然而很多时候并不是所有文件都需要打包,比如 .gitignore 文件就是典型。
可以通过把不需要的文件放到 .gitattributes 文件中使用 export-ignore 来排除掉这些不需要被打包的文件。
.gitignore export-ignore .gitattributes export-ignore /test export-ignore
但要记得,这个文件要提交之后才会生效。
参考:
文章评论
0
发表评论
登录
登出
还没有用户发表过评论,我要发表评论。
编辑评论