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

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

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

30条回答
  •  闹比i
    闹比i (楼主)
    2020-11-22 01:06

    To remove the untracked files you should first use command to view the files that will be affected by cleaning

    git clean -fdn
    

    This will show you the list of files that will be deleted. Now to actually delete those files use this command:

    git clean -fd
    

提交回复
热议问题