美文网首页
MERGE_HEAD exists

MERGE_HEAD exists

作者: 大头青年 | 来源:发表于2017-08-16 12:32 被阅读250次

    You have not concluded your merge. (MERGE_HEAD exists)

    Git本地有修改如何强制更新

    本地有修改和提交,如何强制用远程的库更新更新。我尝试过用git pull -f,总是提示 You have not concluded your merge. (MERGE_HEAD exists)。

    我需要放弃本地的修改,用远程的库的内容就可以,应该如何做?笨办法就是用心的目录重新clone一个,正确的做法是什么?

    正确的做法应该是:

    git fetch --all

    git reset --hard origin/master

    git fetch 只是下载远程的库的内容,不做任何的合并git reset 把HEAD指向刚刚下载的最新的版本

    参考链接:

    http://stackoverflow.com/questions/1125968/force-git-to-overwrite-local-files-on-pull

    相关文章

      网友评论

          本文标题:MERGE_HEAD exists

          本文链接:https://www.haomeiwen.com/subject/onkirxtx.html