Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gitignore not unignoring specific bin folder

I have this directory structure (simplified for illustration purposes):

parent
--directory1
----bin
--directory2
----bin
-directory3
----bin

... and so on

I would like all 'bin' directories to be ignored by Git, except for just one of them (directory2/bin). I tried this, but it doesn't seem to work:

[Bb]in
!directory2/[Bb]in

This doesn't work either

[Bb]in
!parent/directory2/[Bb]in

I also tried this and it doesn't work:

[Bb]in
!parent/directory2/[Bb]in/*

Anyone know how I can get this to work?

like image 906
Johnny Oshika Avatar asked Oct 30 '12 00:10

Johnny Oshika


1 Answers

I used git to create a local repository based on the information in your question. However, once I had done so, the problem you are describing didn't exist and I couldn't easily find a way to introduce the problem.

It worked with this .gitignore in parent:

[Bb]in
!directory2/[Bb]in

And it also worked with this .gitignore in the root:

[Bb]in
!parent/directory2/[Bb]in

It seems the problem is not in the structure you have given in the question, but I don't have any idea where it would be then or where to start looking...

like image 54
Jasper Avatar answered Oct 18 '22 10:10

Jasper