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

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

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

30条回答
  •  佛祖请我去吃肉
    2020-11-22 01:02

    A better way is to use: git clean

    git clean -d -x -f
    

    This removes untracked files, including directories (-d) and files ignored by git (-x).

    Also, replace the -f argument with -n to perform a dry-run or -i for interactive mode and it will tell you what will be removed.

提交回复
热议问题