• Git出现error: Your local changes to the following files would be overwritten by merge: ... Please, commit your changes or stash them before you can merge.的问题解决(Git代码冲突)


    在使用git pull拉取服务器最新版本时,如果出现error: Your local changes to the following files would be overwritten by merge: ... Please, commit your changes or stash them before you can merge.错误时,代表这代码冲突了,本地修改了代码导致无法覆盖服务器上的。

    此时有如下解决方法:

    注意:在做所有操作前,切记要先备份本地代码。

    1、如果希望保留生产服务器上所做的改动,仅仅并入新配置项, 处理方法如下:

    git stash
    git pull
    git stash pop

    然后可以使用Git diff -w +文件名来确认代码自动合并的情况。

    2、如果要直接使用服务器上最新版本,那么可以选择直接覆盖

    git reset --hard
    git pull

    其中git reset是针对版本。

  • 相关阅读:
    Excel—TIME函数简介与用法
    Excel—LEFT、RIGHT、MID函数提取不同位置的字段
    $scope.triggerSave $scope.createForm.dayType.$dirty = false;
    SVN clean up的作用
    js 获取当年到今日的时间区间
    jersey
    vector
    AngularJS 2
    URL 字符介绍
    JS factory
  • 原文地址:https://www.cnblogs.com/zhaoyingjie/p/8110217.html
Copyright © 2020-2023  润新知