Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
使用 NGi,我需要运行与以下 CLI 命令等效的git clean命令:
git clean -f -d
但是CleanCommand 类中没有强制或清理目录等选项。这里最好的解决方法是什么?
JGit(NGit 所基于)支持-d,请参阅API 文档。
-d
所以似乎最好的解决方案是如果 NGit 更新到最新的 JGit 版本,我会为此提交一个错误。
至于解决方法,也许可以自己实现,请参阅 CleanCommand 的Java 实现(如果 Ngit 为此提供了必要的低级 API)。