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

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

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

30条回答
  •  不思量自难忘°
    2020-11-22 00:55

    If needed to remove untracked files from particular subdirectory,

    git clean -f {dir_path}
    

    And combined way to delete untracked dir/files and ignored files.

    git clean -fxd {dir_path}
    

    after this you will have modified files only in git status.

提交回复
热议问题