Gitignore not overriding a specific bin folder

Strange, the answers to other similar questions do not work for me, since my situation is slightly different from what others asked in StackOverflow.

I have this directory structure (simplified for illustration):

parent --directory1 ----bin --directory2 ----bin -directory3 ----bin ... and so on 

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

 [Bb]in !directory2/[Bb]in 

This does not work.

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

I tried this too and it does not work:

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

Does anyone know how I can make this work?

thanks

+4
source share
1 answer

I used git to create a local repository based on the information in your question. However, as soon as I did this, the problem you are describing did not exist, and I could not easily find a way to introduce the problem.

He worked with this .gitignore in parent :

 [Bb]in !directory2/[Bb]in 

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

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

It seems that the problem is not in the structure that you asked in the question, but I do not know where it would be or where to start looking ...

+4
source

Source: https://habr.com/ru/post/1442882/


All Articles