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

Re: Feat. req.: add a flag to `git clean` to also remove ignored nested repositories

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Jan 9, 2026, 13:18 UTC
Message-ID
<aWEAHQLzwTxCpD5Q@fruit.crustytoothpaste.net>
In-Reply-To
<CA+itcS3-RQ=ESqcWj0Pkw=N4e4gwaz2fp2xH2M1MPXQXaMDmCw@mail.gmail.com>
On 2026-01-09 at 03:50:30, Simon Cheng wrote:
Show 16 quoted lines
> Currently, running `git clean -dxf` on a repository that includes
> another repository under an ignored path would skip said repository:
> 
> $ git clean -dxf
> Removing foo
> Skipping repository ignored-path/repo
> Removing bar
> 
> This is to request the addition of a new flag to allow altering this
> behaviour, i.e. to make `git clean` remove those repositories too.
> 
> For me, this feature is relevant for building `*-git` packages from
> the AUR, for example https://aur.archlinux.org/packages/paru-git. By
> default `makepkg` would clone the source repo into `./src/NAME`, which
> creates the aforementioned condition. Without such an option on `git
> clean`, cleanup after build is rather complicated.

Does this work if you use `git clean -dxff` (that is, with a second `-f` flag)? I do often clean up ignored repositories that way (and it's documented to do that in the manual page), but I'm not sure if you're maybe doing something a little different from my workflow.

If that _doesn't_ work for you, would you mind creating a quick shell script to demonstrate the problem that you're seeing so that we could provide better advice?

-- 
brian m. carlson (they/them)
Toronto, Ontario, CA
Previous: Simon ChengNext: Simon Cheng
Message 2 of 3 in “Feat. req.: add a flag to `git clean` to also remove ignored nested repositories”
  1. Simon ChengJan 9, 2026
  2. brian m. carlsonJan 9, 2026
  3. Simon ChengJan 16, 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.