| Crates.io | git-nuke |
| lib.rs | git-nuke |
| version | 0.2.2 |
| created_at | 2024-03-21 08:02:00.566237+00 |
| updated_at | 2025-05-14 23:49:56.915349+00 |
| description | Remove all ignored files from a git workspace, fast |
| homepage | |
| repository | https://github.com/simonbuchan/git-nuke |
| max_upload_size | |
| id | 1181319 |
| size | 33,126 |
git-nukegit-nuke is a Rust binary that intends to provide a more reliable version of git clean -dXf for
Windows, though it may still be useful for other platforms.
Install with cargo install git-nuke and run with git nuke with the directory to be cleaned,
using the current directory by default.
If the directory is not the git working directory root, git-nuke will search for the git root and
include parent .gitignore files as git does, but will only remove directories that are within
the provided directory unless -a / --all is provided.
It will also not remove files in the git index, unless -i / --ignore-index is provided. It's quite
likely this doesn't correctly parse all the various index versions, in particular:
extensions.objectFormat) is also not supported yet
as config parsing is not yet implementedCurrently, git will not create these formats by default, so it shouldn't be much of a problem yet.
git clean -dXf will clear out every ignored file in a git working directory,
returning it to a clean state. Unfortunately, it does not yet understand Windows'
directory junctions, so in node monorepos / workspaces where projects use them to
reference the local code as a dependency, git clean -dXf will sometimes delete the
source code!
It's also absurdly slow (at least on Windows), and can use gigabytes of memory in large repositories, which Rust makes trivial to fix.
Since it was pretty easy to add, I also put in showing a progress indicator for removing directories. There's probably plenty of improvements here...