忽略分支中的文件

发布于 2024-12-04 05:20:00 字数 94 浏览 2 评论 0原文

我正在开发一个新创建的分支,并在该分支中生成了一些图像。问题是我的 .gitignore 文件中有 *.png,但 git 继续跟踪它们。您知道如何忽略该分支中的图片文件吗?

I was working on a new created branch, and I generated some images in that branch. The thing is that i have *.png in my .gitignore file, but git continue to track them. Do you have any idea about how can I ignore the picture files in this branch?

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

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

发布评论

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

评论(1

九厘米的零° 2024-12-11 05:20:00

Git 不会停止跟踪存储库中已有的文件。 ignore 指令只是阻止它自动添加新文件。如果您想停止跟踪它们,则必须显式删除它们(可能是 git rm --cached )。

Git will not stop tracking files that are already in your repository. The ignore directive merely prevents it from adding new files automatically. If you want to stop tracking them, you have to explicitly remove them (git rm --cached, probably).

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