0

git clean使用该-ffxd选项不会清理调用的目录.git- 我该怎么做?

使用 git 2.32.0

mkdir myrepo && cd myrepo
git init .
mkdir src && cd src
touch code.cpp
git add code.cpp
git commit -m "my commit"
mkdir .git .git2
git clean -ffxdn
Would remove .git2/

但我也希望 git clean 删除.git。但它被忽略了。

来自man git-clean

       -f, --force
           If the Git configuration variable clean.requireForce is not
           set to false, git clean will refuse to delete files or
           directories unless given -f or -i. Git will refuse to
           modify untracked nested git repositories (directories with
           a .git subdirectory) unless a second -f is given.

那我做错了什么?

4

0 回答 0