Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

git

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

*\bin

Shouldn't it work the same across all platforms?

like image 984
Andrew Young Avatar asked Aug 10 '11 23:08

Andrew Young


1 Answers

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
{...}
like image 63
Augusto Avatar answered Oct 17 '22 21:10

Augusto