How can I make git list only the tracked directories in a folder?
I think this will give you what you want:
git ls-files | xargs -n 1 dirname | uniq
So, take the output of git ls-files
and pipe that into dirname
, then uniq
the results. This appears to work locally for me.