git pull 提示错误,Your local changes to the following files would be overwritten by merge

Posted smart-girl

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了git pull 提示错误,Your local changes to the following files would be overwritten by merge相关的知识,希望对你有一定的参考价值。

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

解决办法:
1、服务器代码合并本地代码

$ git stash     //暂存当前正在进行的工作。
$ git pull   origin master //拉取服务器的代码
$ git stash pop //合并暂存的代码

2、服务器代码覆盖本地代码

$git reset --hard  //回滚到上一个版本
$git pull origin master 

技术图片
技术图片
技术图片
技术图片

以上是关于git pull 提示错误,Your local changes to the following files would be overwritten by merge的主要内容,如果未能解决你的问题,请参考以下文章