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?
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...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With