gpt4 book ai didi

git - 我如何使用 .gitattributes 来避免在 git root 中包含一个文件夹,但在 dist 文件夹中包含同名的文件夹以进行 zip

转载 作者:太空狗 更新时间:2023-10-29 14:08:49 25 4
gpt4 key购买 nike

我在存储库的根目录中有一个名为 lib 的文件夹,在 dist 文件夹中有另一个名为 lib 的文件夹。

我正在尝试使用 .gitattributes 文件来排除除 dist 之外的所有文件夹和文件,以便任何人以 zip 或 tarball 格式下载都只会对分发文件进行 git

我的问题是下面的 .gitattributes 文件也删除了 dist 文件夹中的 lib 文件夹

.gitattributes export-ignore
.gitignore export-ignore
Cakefile export-ignore
swagger-ui.json export-ignore
bin export-ignore
lib export-ignore
node_modules export-ignore
src export-ignore

我尝试在 lib 之前添加斜杠,在 lib 之后似乎没有任何帮助

如何让它发挥作用?

最佳答案

你应该能够创建一个 dist/.gitattributes 条目:

lib -export-ignore

关闭该特定目录的该属性。还没有真正尝试过,但是手册页暗示这是这样做的方法。目前还不清楚(对我来说,无论如何).gitattributes 中的模式字段是否以与 .gitignore 中相同的方式解释,这可能解释了为什么添加“/”没有没有按您预期的方式工作。

关于git - 我如何使用 .gitattributes 来避免在 git root 中包含一个文件夹,但在 dist 文件夹中包含同名的文件夹以进行 zip,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12464258/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com