问题描述
本地branch状态与远程branch状态不一致,并且有conflicts。此时如果想将本地branch更新同远程branch一样的状态,直接进行pull,会有很多conflicts。
解决方法
1. 尝试将本地分支回退到一个可以fast-forward的commit,然后进行pull操作。
git reset --hard {some_commit}
git pull origin {local_branch_name}
或者:
2. 从远程repository fetch,然后强制更新local branch.
git fetch --all
git reset --hard origin/{remote_branch_name}