使用git拉取代码时出现的问题

使用git pull拉取代码时报如下错误:

Your local changes to the following files would be overwritten by merge:
project.config.json
Please commit your changes or stash them before you merge.

如图:

原因:本地修改了一些文件,远程仓库中的这些文件也做了更改,两个文件中的内容不一致

解决方法:取消本地所有更改,命令:git stash

git stash #把所有没有提交的修改暂存到stash里面。可用git stash pop回复

如图:

 

 

然后再git pull拉取代码即可,如图:

 

posted @ 2020-09-21 09:54  雁过听雪落  阅读(1154)  评论(0)    收藏  举报