避免使用一个文件夹上的gitignore

发布于 2025-02-04 02:30:48 字数 103 浏览 1 评论 0原文

我的存储库上有一个.gitignore文件,以防止上传某些文件。

但是我想在此存储库中有一个单个文件夹,允许使用各种文件。

如何在该文件夹上扫描Gitignore?

I have a .gitignore file on my repository to prevent uploading some files.

But I want to have a single folder inside this repository where all kind of files are allowed.

How can I scape the gitignore on that folder?

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

为人所爱 2025-02-11 02:30:48

您可以在.gitignore中否定模式,从而导致包含其他排除的文件。

!folderX/**/*

.gitignore中的类似行将“取消分解” folderx及其子文件夹中的所有文件。

注意:.gitignore文件是从上到下解析的。 在末尾添加此行
此行之后的任何规则都可以覆盖其效果。

You can negate patterns in .gitignore, causing otherwise excluded files to be included.

!folderX/**/*

A line like this in .gitignore will "unexclude" all files in folderX and its subfolders.

Note: The .gitignore file is parsed from top to bottom. Add this line at the end.
Any rule that comes after this line can override its effect.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文