git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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 ?
Next: Andreas Ericsson
Message 1 of 3 in “List of directories containing only ignored files”
  1. Marcin WiśnickiOct 6, 2011
  2. Andreas EricssonOct 6, 2011
  3. Marcin WiśnickiOct 6, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.