The difference between a/ and a/* and a/** in .gitignore?

Viewed 1792

Here is my file folder.

a
├─ b
│  ├─ b1.txt
│  └─ b2.txt
├─ a1.txt
└─ a2.txt
.gitignore

Firstly:

I found if I wanna ignore the folder a, a/ and a/* and a/** all can complete.

Secondly:

I wanna ignore all the things in folder a except the folder b, the only way to do this is:

a/*
!a/b/

I don't know why a/** can't do this?

# this way can't except folder b
a/**
!a/b/

Or you can tell me how can I use a/** ?

3 Answers
Related