List of directories containing only ignored files
- From
Marcin Wiśnicki <mwisnicki@gmail.com>
- Date
- Oct 6, 2011, 13:56 UTC
- Message-ID
- <CAC9GOO__nN9W1vvoMxq2LKnn=YoFPjTE6jKPbQ2h7im3JtujQA@mail.gmail.com>
What's the easiest way to find all directories that contain only ignored files but are not ignored themselves.
For example, given following .gitignore:
obj/
and following files:
/project1/foo.c /project1/obj/foo.o /project2/obj/bar.o
Where /project2 contains leftovers from different branch that are not cleared on switch because they are ignored.
I would like to see:
/project2
Alternatively: how to remove such leftovers when switching branches ?