【问题标题】:Some git equivalents for Plastic塑料的一些 git 等价物
【发布时间】:2020-06-27 00:54:11
【问题描述】:

PlasticSCM 等效于:

git clean -dxf
git clean -dx

我想从我的项目树中删除所有未跟踪的文件,或从我的项目树中删除所有未跟踪但未被忽略、隐藏或私有的文件。

【问题讨论】:

  • 如果你运行“cm status --private”,你应该得到一个私有项目的列表,不包括被忽略的项目。我猜您想删除私有文件(存储在工作区路径中但不受源代码控制的文件)。为了删除它们:“cm status --private --short | xargs rm”。

标签: plasticscm


【解决方案1】:

没有等价物。 PlasticSCM 拒绝实施此feature

你可以找到解决这个问题的思路here

我为 Windows 批处理实现了这个:

REM - Delete private files
for /f %%a in ('cm status --private --compact --short %~1') do (
   REM - IF IS DIRECTORY
   IF EXIST %%~sa\NUL ( rmdir /s /q "%%a" ) ^
   else ( del /s /q "%%a" )
)

REM - Delete ignored files
for /f %%a in ('cm status --ignored --cutignored --compact --short %~1') do (
   REM - IF IS DIRECTORY
   IF EXIST %%~sa\NUL ( rmdir /s /q "%%a" ) ^
   else ( del /s /q "%%a" )
)

【讨论】:

    猜你喜欢
    • 2021-03-13
    • 1970-01-01
    • 1970-01-01
    • 2011-08-14
    • 2015-09-28
    • 1970-01-01
    • 2021-08-26
    • 1970-01-01
    • 2017-09-23
    相关资源
    最近更新 更多