我有一个这样的目录结构:
.git/
.gitignore
main/
...
tools/
...
...
在 main 和 tools 以及任何其他目录中,在任何级别,都可以有一个“bin”目录,我想忽略它(我也想忽略它下面的所有内容)。我已经在 .gitignore 中尝试了这些模式中的每一个,但它们都不起作用:
/**/bin/**/*
/./**/bin/**/*
./**/bin/**/*
**/bin/**/*
*/bin/**/*
bin/**/*
/**/bin/* #and the others with just * at the end too
谁能帮我吗?如果我这样做,第一个模式(我认为应该工作的模式)工作得很好:
/main/**/bin/**/*
但是我不想为每个顶级目录都有一个条目,也不想每次添加新目录时都必须修改 .gitignore 。
这是在 Windows 上使用最新的 msysgit。
编辑:还有一件事,有些文件和目录的名称中包含子字符串“bin”,我不希望这些被忽略:)