Git 清除未在 git 状态中显示的已删除文件

Git clean removed files not shown in git status

首先我运行git状态

[user@dev config]$ git status
# On branch master
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#       app1-core/
#       app1/local.json.hold
nothing added to commit but untracked files present (use "git add" to track)

稍后我运行git清理

[user@dev config]$ git clean -xfd
Removing app2/local.json
Removing app3/local.json
Removing app4/local.json
Removing app5/local.json
Removing app6/local.json
Removing app1-core/
Removing app1/local.json.hold

我想知道为什么它删除了这些在上面的 git 状态命令中未显示为未跟踪的附加文件。

因为-x表示:"don’t use the standard ignore rules read from .gitignore"