.gitignore中的!配置项为什么不起作用

查看:95
本文介绍了.gitignore中的!配置项为什么不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问 题


我想要将/public/examples/images/目录不忽略,但是这样配置后并不能起作用!

按照逻辑感觉应该是合理的,因为之前已经忽略了/public/examples/目录了,那么它下面的目录肯定应该是被忽略了的啊。

但是找了一下.gitignore的配置项的介绍,发现我的配置方法并没有错!这就让人很忧伤了,不明白为什么到底不起作用了。。。

解决方案

gitignore手册中对这一点有特别说明,如果一个父目录已经被设置为不包含,那么他的子目录是不可能被重新再用!包含回来的。

An optional prefix "!" which negates the pattern; any matching file excluded by a previous pattern will become included again. It is not possible to re-include a file if a parent directory of that file is excluded.

这篇关于.gitignore中的!配置项为什么不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆