How to remove local (untracked) files from the current Git working tree

前端 未结 30 2747
死守一世寂寞
死守一世寂寞 2020-11-22 00:07

How do you delete untracked local files from your current working tree?

30条回答
  •  猫巷女王i
    2020-11-22 00:56

    To know what will be deleted before actually deleting:

    git clean -d -n

    It will output something like:

    Would remove sample.txt

    To delete everything listed in the output of the previous command:

    git clean -d -f

    It will output something like:

    Removing sample.txt

提交回复
热议问题