gitignore 尾随 /** 与尾随 / 与仅放置目录
我试图了解是否需要在 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论