Q:

Non-interactive "git clean -fdx"

I'm building a thing that processes incoming file packages, but I have the rather serious problem that I can't sanitize the incoming data until it's in a position to break the processing, and it breaks it such a way that simply restarting the process doesn't fix it.
My current best solution is to git clean -fdx and git checkout . the project directory the process uses, which works like a charm, except that sometimes git clean asks for user input ("cannot unlink file. Retry?"), which causes a problem for automation.
Is there a way to put Git into a non-interactive mode? I need to do this from inside Ruby on a Windows machine.

A:

For Windows, this is what worked for me (sets the GIT_ASK_YESNO environment variable to false, stopping git from asking yes-no questions):
set GIT_ASK_YESNO=false

Then when I get those same messages as warnings but it continues as if I said no.
So git clean -fdx works for me as expected without blocking. 

