.gitignore does not understand my folder wildcard on windows

谁都会走 提交于 2019-11-29 01:27:16

Since git 1.8.2 (March, 8th 2013), the ** is now supported:

The patterns in .gitignore and .gitattributes files can have **/, as a pattern that matches 0 or more levels of subdirectory.

E.g. "foo/**/bar" matches "bar" in "foo" itself or in a subdirectory of "foo".

In your case, that means this line might now be supported:

!/Dependencies/**/*.exe

The .gitignore documentation says:

git treats the pattern as a shell glob suitable for consumption by fnmatch(3) with the FNM_PATHNAME flag

It's possible that fnmatch on your platform does not support ** in a path.

You could add a .gitignore file to the Dependencies folder with

*.exe

inside. The obvious downside is that ignore the specifications are scattered among several files now.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!