忽略分支中的文件
我正在开发一个新创建的分支,并在该分支中生成了一些图像。问题是我的 .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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
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).