git Please move or remove them before you can merge. 错误解决方案

合并分支或者git pull命令的时候遇到:

Updating 7c9e086..936acac
error: The following untracked working tree files would be overwritten by merge:
Common/HFHttpRequest/HFHttpRequestParameters.h
Common/HFHttpRequest/HFHttpRequestParameters.m

Please move or remove them before you can merge.
Aborting

 解决方法,项目根目录下运行git命令

$git clean -d -fx .

x -----删除忽略文件已经对git来说不识别的文件

d -----删除未被添加到git的路径中的文件

f -----强制运行

注意:会把硬盘中,很多未被跟踪的文件会被删除!特别是新建的文件。

posted @ 2020-05-23 13:58  tochenwei  阅读(2373)  评论(0编辑  收藏  举报