I\'d like to only track certain directories in git in a larger project, where most directories will be excluded and only a few will be tracked. So, I wanted to use
In case none of the above works try this variation inside .gitignore
Not working for me: !build/**/* Working for me: !build**/*
For some reason this was the only way it worked for me.