清除 git 中 Untracked files

2021-05-07  本文已影响0人  tafanfly

在git管理的项目下, 做一些编译或者运行测试的操作,会产生一些未追踪的文件Untracked files, 可以使用git clean命令来删除。

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   info.py

Untracked files:
  (use "git add <file>..." to include in what will be committed)
        test/log/
        test/info.txt

no changes added to commit (use "git add" and/or "git commit -a")

$ git clean -nfd
Would remove test/log/
Would remove test/info.txt

$ git clean -fd
Removing test/log/
Removing test/info.txt
上一篇 下一篇

猜你喜欢

热点阅读