开发者

Why does git not respect my .gitignore file on windows?

I'm trying to setup a .gitignore file with the following rule

*/bin

but it is not ignoring all bin folders unless I use a backslash

开发者_Go百科
*\bin

Shouldn't it work the same across all platforms?


you don't need to specify the * at the beginning. The following example will ignore any bin or Bin directory in any part of the directory tree.

[Bb]in/

The previous example is for visual studio, as it creates the bin folder in lower or upper case. You can see an example of a .gitignore that I've used in windows here.

I forgot to add that if you're going to use git on windows, you might want to set to ignore case in the configuration file in .git/config by adding

[core]
{...}
    ignorecase = true
{...}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜