非交互式"git clean -fdx" [英] Non-interactive "git clean -fdx"

查看:118
本文介绍了非交互式"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.

我目前的最佳解决方案是git clean -fdxgit checkout .该进程使用的项目目录,其工作方式像超级字符,除了,有时git clean要求用户输入(无法取消链接"文件.重试?"),这会导致自动化问题.

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.

有没有办法让Git进入非交互模式?我需要在Windows计算机上的Ruby内部执行此操作.

Is there a way to put Git into a non-interactive mode? I need to do this from inside Ruby on a Windows machine.

推荐答案

对于Windows,这对我有用(将GIT_ASK_YESNO环境变量设置为false,从而阻止git询问是或否的问题):

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.

所以git clean -fdx为我工作,如预期的那样,没有阻塞.

So git clean -fdx works for me as expected without blocking.

这篇关于非交互式"git clean -fdx"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆