magit 中的 git clean -f -d -x 相当于什么

hbo*_*ert 3 emacs magit

我希望能够顺利 z -a z进入 magit-status并且能够stash pop / z p顺利进入。然而,将所有内容存储在 Magit 中显然意味着将忽略的目录保存到存储中,而不是将其从工作目录中删除。

结果是您不能简单地弹出存储,因为存储将尝试弹出已存在的被忽略目录中的文件。

重播:

git init 
mkdir ignoreme
touch ignoreme/ignoremefile
git init
echo ignoreme > .gitignore
git add .gitignore
git commit -m "add ignore file"
emacs
  m-x magit-status; z; -a;z
git stash pop
  ignoreme/ignoremefile already exists, no checkout
  Could not restore untracked files from stash
Run Code Online (Sandbox Code Playgroud)

小智 5

您可以运行C-u M-x magit-clean!! clean -xd.

(您建议的命令缺少-x标志。 git clean -d将删除未跟踪但不被忽略的目录。)