gitignore 尾随 /** 与尾随 / 与仅放置目录

发布于 2025-01-14 12:57:08 字数 313 浏览 3 评论 0原文

我试图了解是否需要在 gitignore 文件的目录列表中添加尾随 /** 。

doc-assets
doc-assets/
doc-assets/**

都是一样的东西 ?我没有看到区别,但人们似乎在其他答案中指定 /** 包含目录中的所有项目...如果我只是忽略目录本身,这似乎是不必要的。

在本例中,该目录位于 git 存储库的根目录,并且 .gitignore 也位于根目录中。

是否有可能由于特殊性(或缺乏特殊性),人们可以指定不忽略的文件?使用这三个忽略选项之一而不是另一个还有什么其他原因?

I'm trying to understand if I need to put a trailing /** on my directory list for my gitignore file.

Are

doc-assets
doc-assets/
doc-assets/**

all the same thing? I'm not seeing a difference, but people seem to specify in other answers here that the /** includes all items in a directory... which seems unnecessary if I'm just ignoring the directory itself.

In this case, the directory is at the root of the git repository, and .gitignore is in the root as well.

Is it possible that the specificity (or lack thereof) is so people can specify files NOT to ignore? What other reasons would there be for using one of those three ignore options over another?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文