今日git pull时报错
Pull is not possible because you have unmerged files.
hint:Fix them up in the work tree,and then use 'git add/rm <file>'
hint: as appropriate to mark resolution and make a commit.
fatal:Exiting because of an unresolved conflict.
本地的push和merge会形成MERGE-HEAD(FETCH-HEAD), HEAD(PUSH-HEAD)这样的引用。HEAD代表本地最近成功push后形成的引用。MERGE-HEAD表示成功pull后形成的引用。
办法1.pull会使用git merge导致冲突,需要将冲突的文件resolve掉 git add -u, git commit之后才能成功pull.
办法2.如果想放弃本地的文件修改,可以使用git reset --hard FETCH_HEAD,FETCH_HEAD表示上一次成功git pull之后形成的commit点。然后git pull.
注意是“--hard” 两条- ,某度的有些是-hard,会报错。