{"thread":{"id":"64937","subject":"git clean ignore","startedAt":"2026-02-07T14:53:48Z","lastAt":"2026-02-08T02:28:12Z","messageCount":3,"participants":["Sylvain Rabot","Kristoffer Haugsbakk","D. Ben Knoble"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"535414","messageId":"CADjtP1FSAQZRyBCjPZ00Y2g=fdtRZWHP44XLqjor-OrYXAN-vw@mail.gmail.com","threadId":"64937","inReplyTo":null,"subject":"git clean ignore","fromName":"Sylvain Rabot","fromEmail":"sylvain@abstraction.fr","sentAt":"2026-02-07T14:53:36Z","receivedAt":"2026-02-07T14:53:48Z","isPatch":false,"sender":{"key":"sylvain@abstraction.fr","avatar":"https://avatars.githubusercontent.com/u/153052?v=4"},"body":"Hi,\n\nI'm a big user of git clean -fdx which is the shortest path to a clean worktree.\n\nHowever, I repeatedly found myself deleting precious git ignored\nresources such as editor/debug configurations so I asked myself if the\ngit ignore mechanism could be applied to git clean so that we can\ndeclare a list of patterns git clean should never remove.\n\nI launched an AI agent on this and here is the result:\nhttps://github.com/sylr/git/commit/13d0177c52130782bcf7877895a5b497abdfba86\n\nSince I'm no C developer I'm not really qualified to review the AI\noutput but it seems to do what I wanted. I'm not expecting it to be\nmerged but I am wondering if this is a feature git would be likely to\nimplement ?\n\nRegards.\n\n-- \nSylvain Rabot <sylvain@abstraction.fr>\n"},{"id":"535419","messageId":"c5d1faf0-a7ea-4be0-b9eb-3bcb5f1ae0a2@app.fastmail.com","threadId":"64937","inReplyTo":"CADjtP1FSAQZRyBCjPZ00Y2g=fdtRZWHP44XLqjor-OrYXAN-vw@mail.gmail.com","subject":"Re: git clean ignore","fromName":"Kristoffer Haugsbakk","fromEmail":"kristofferhaugsbakk@fastmail.com","sentAt":"2026-02-07T15:00:00Z","receivedAt":"2026-02-07T15:00:42Z","isPatch":false,"sender":{"key":"kristofferhaugsbakk@fastmail.com","avatar":null},"body":"On Sat, Feb 7, 2026, at 15:53, Sylvain Rabot wrote:\n> Hi,\n>\n> I'm a big user of git clean -fdx which is the shortest path to a clean worktree.\n>\n> However, I repeatedly found myself deleting precious git ignored\n> resources such as editor/debug configurations so I asked myself if the\n> git ignore mechanism could be applied to git clean so that we can\n> declare a list of patterns git clean should never remove.\n>[snip]\n\nRelated: https://lore.kernel.org/git/pull.1627.git.1703643931314.gitgitgadget@gmail.com/T/#u\n"},{"id":"535459","messageId":"CALnO6CAS5bpxDuqZ1Tf=SeY5Z6JpRpm1vbPCUtnyj6AsNqGJ8Q@mail.gmail.com","threadId":"64937","inReplyTo":"CADjtP1FSAQZRyBCjPZ00Y2g=fdtRZWHP44XLqjor-OrYXAN-vw@mail.gmail.com","subject":"Re: git clean ignore","fromName":"D. Ben Knoble","fromEmail":"ben.knoble@gmail.com","sentAt":"2026-02-08T02:28:01Z","receivedAt":"2026-02-08T02:28:12Z","isPatch":false,"sender":{"key":"ben.knoble@gmail.com","avatar":"https://avatars.githubusercontent.com/u/22802209?v=4"},"body":"On Sat, Feb 7, 2026 at 9:53 AM Sylvain Rabot <sylvain@abstraction.fr> wrote:\n>\n> Hi,\n>\n> I'm a big user of git clean -fdx which is the shortest path to a clean worktree.\n\nIf you can't drop -x for some reason, consider \"git worktree add\" ?\n\n-- \nD. Ben Knoble\n"}]}