git - fatal : clean. requireForce 默认为 true 且未给出 -i、-n 或 -f;拒绝打扫

标签 git version-control

当我尝试通过 git clean 清理所有未跟踪的文件时,它显示错误:

fatal: clean.requireForce defaults to true and neither -i, -n, nor -f given; refusing to clean

如何解决?

最佳答案

您必须在 .gitconfig 中将 requireForce 设置为 false 或使用 -f-i 使用此命令进行标记。

  1. git clean -f 将强制清理未跟踪的文件,即使 clean.requireForce 设置为默认值 true。
  2. git clean -i 将为您提供一种交互式方式来清理每个文件
  3. git clean -n 将仅显示如果执行 git clean 将删除哪些文件。

引用:https://git-scm.com/docs/git-clean

关于git - fatal : clean. requireForce 默认为 true 且未给出 -i、-n 或 -f;拒绝打扫,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34542204/

相关文章:

git - kex_exchange_identification : read: Operation timed out

javascript - Gulp 失败并返回 Unhandled 'error' 事件

git - 使用 Plesk Onyx 的 Git 扩展提交在服务器上所做的更改

version-control - Clearcase Albd 服务不可用

svn - 单独使用 SVN 或在小型工作组中使用 - 工作流方法?

git - 使用 Git 或 Bazaar 管理代码更容易吗?

GitHub API : How to get branch name from commit list?

git fatal : UriFormatException encountered. actualUrl

version-control - 如何在 Visual Studio 2010 Premium/Ultimate 中设置 TFS 2010?

Git 在一行内 merge