当前位置:   article > 正文

git远程强制更新到本地_git强制更新远端代码到本地哦

git强制更新远端代码到本地哦

当 git pull 有冲突时:

$ git pull
From https://github.com/acn-yunan-hu/test
   2f97dc7..dce8319  step5/test -> origin/step5/test
error: Your local changes to the following files would be overwritten by merge:
        【BlueStep5】ソースRv指摘一覧.xlsx
Please commit your changes or stash them before you merge.
Aborting
Updating 2f97dc7..dce8319
如果想放弃本地更改,用远程的替换本地代码时,可以用下面方法:

git强制覆盖:
    git fetch --all
    git reset --hard origin/step5/test
    git pull

git强制覆盖本地命令(单条执行):
    git fetch --all && git reset --hard origin/step5/test && git pull

当然如果你想有冲突文件保存本地更改的时候,可以将 git reset --hard 换成 git reset --soft
 

声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:【wpsshop博客】
推荐阅读
相关标签
  

闽ICP备14008679号