Please commit your changes or stash them before you merge. Aborting

有的时候使用git pull命令,可能遇到这样的问题:

这是由于远程库中的更改与本地的更改有冲突。

git的提示已经非常明确了,告诉我们要么把我们的更新进行commit要么就先stash本地更新。

第一种方法,stash:

那怎么stash本地的更新呢?直接执行:

$ git pull origin master
From https://github.com/lollxxxx/lollicxxxxupStoxxre2
 * branch                master     -> FETCH_HEAD
error: Your local changes to the following files would be overwritten by merge:
        app/etc/modules/Mirasvit_Advd.xml
        app/etc/modules/Mirasvit_Advr.xml
Please commit your changes or stash them before you merge.
Aborting
Updating a690d45f3..b4cae49e0

lollicup@DESKTOP-4M99Q31 MINGW64 /d/www/lollicupStore2 (master)
$ git reset --hard
HEAD is now at a690d45f3 Merge pull request #373 from lollicupusa/storex

lollicup@DESKTOP-4M99Q31 MINGW64 /d/www/lollicupStore2 (master)
$ git log
commit a690d45f34bdb88c429cc3add8ab7ec54a0fbe38 (HEAD -> master, sun_masterer_developertoolbar)
Merge: b1d57cde2 fdfeb8976
Author: Aaron Liu <shurui91@gmail.com>
Date:   Wed Aug 7 12:16:03 2019 -0700

    Merge pull request #373 from lollicupusa/storex

    homepagebanner images updated, typo fixed

https://blog.csdn.net/liuchunming033/article/details/45368237

Leave a comment

您的电子邮箱地址不会被公开。 必填项已用*标注