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

BUG: sub-git files getting cleaned when using --exclude in the top git

From
JBJehan Bing <jbing@codeaurora.org>
Date
Jun 22, 2018, 01:09 UTC
Message-ID
<006b01d409c5$b7898f80$269cae80$@codeaurora.org>
Hi,

I have a setup with tree of 250+ git repositories. Every now and then, I want to clean everything except for files generated by my IDE. So for all the git repos, I run “git clean -dfx --exclude <ide file>”. What happens then is, if a sub-git as that file, all its files are deleted (except for that ide file) instead of being skipped.

Here is a simplified setup:
       git init a
       cd a
       git init b
       touch b/1 b/2
Now, if I run (from a):
       git clean -dfx
git says “Skipping repository b/” and nothing is cleaned, as expected.
But if I run:
       git clean -dfx -e 1
then there is no “skipping” message and b/2 is deleted even if it is a file
tracked by b.
I would expect b to still be skipped and left untouched.
Regards,
  Jehan
Message 1 of 1 in “BUG: sub-git files getting cleaned when using --exclude in the top git”
  1. Jehan BingJun 22, 2018

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.