git pull报错

来源:互联网 发布:麦迪生涯数据统计 编辑:程序博客网 时间:2024/05/21 22:43
<div id="sina_keyword_ad_area2" class="articalContent   "><p>今天在服务器上git pull是出现以下错误:</p><p><span style="CoLor: rgb(255,0,0)">error: Your local changes tothe following files would be overwritten by merge:</span></p><p><span style="CoLor: rgb(255,0,0)"> <wbr> <wbr>  <wbr>  <wbr>application/config/config.php</span></p><p><span style="CoLor: rgb(255,0,0)"> <wbr> <wbr>  <wbr>  <wbr>application/controllers/home.php</span></p><p><span style="CoLor: rgb(255,0,0)">Please, commit your changes orstash them before you can merge.</span></p><p><span style="CoLor: rgb(255,0,0)">Aborting</span></p><p>不知道什么原因造成的代码冲突,处理方法如下:</p><p>如果希望保留生产服务器上所做的改动,仅仅并入新配置项:</p><p>git stash</p><p>git pull</p><p>git stash pop</p><p>然后可以使用git diff -w +文件名 来确认代码自动合并的情况.</p><p>如果希望用代码库中的文件完全覆盖本地工作版本. 方法如下:</p><p>git reset --hard</p><p>git pull</p></div>


参考地址:http://blog.sina.com.cn/s/blog_7e04e0d00101f93r.html

原创粉丝点击