gitignore文件夹名称和通配符

发布于 2025-02-10 21:51:19 字数 151 浏览 1 评论 0原文

我如何才能使用这样的名称进行gitignore: myFolder*.pizza

所以想法是以myFolder开始的任何东西,只要以结尾,任何内容都将被忽略。

How can I gitignore a folder with a name like this:
myfolder*.pizza

So the idea is that anything starting with myfolder, with anything in between as long as it ends with .pizza would be ignored.

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

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

发布评论

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

评论(1

懷念過去 2025-02-17 21:51:19

如果myFolder*.pizza/规则不起作用,则仅意味着已经跟踪了该文件夹中的文件。

在这种情况下:

cd /path/to/repo
find . -name "myfolder*.pizza" -type d -exec git rm -r --cached {} ;

If a myfolder*.pizza/ rule does not work, that should only mean the files in such a folder are already tracked.

In that case:

cd /path/to/repo
find . -name "myfolder*.pizza" -type d -exec git rm -r --cached {} ;
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文