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

git clean ignore

From
Sylvain Rabot <sylvain@abstraction.fr>
Date
Feb 7, 2026, 14:53 UTC
Message-ID
<CADjtP1FSAQZRyBCjPZ00Y2g=fdtRZWHP44XLqjor-OrYXAN-vw@mail.gmail.com>
Hi,
I'm a big user of git clean -fdx which is the shortest path to a clean worktree.

However, I repeatedly found myself deleting precious git ignored resources such as editor/debug configurations so I asked myself if the git ignore mechanism could be applied to git clean so that we can declare a list of patterns git clean should never remove.

I launched an AI agent on this and here is the result: https://github.com/sylr/git/commit/13d0177c52130782bcf7877895a5b497abdfba86

Since I'm no C developer I'm not really qualified to review the AI output but it seems to do what I wanted. I'm not expecting it to be merged but I am wondering if this is a feature git would be likely to implement ?

Regards.
-- 
Sylvain Rabot <sylvain@abstraction.fr>
Next: Kristoffer Haugsbakk
Message 1 of 3 in “git clean ignore”
  1. Sylvain RabotFeb 7, 2026
  2. Kristoffer HaugsbakkFeb 7, 2026
  3. D. Ben KnobleFeb 8, 2026

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.