ローカルの変更を破棄してpullする方法 - meruneru/tech_memo GitHub Wiki

起きた問題

git pullするとconflictが発生して更新できなかった。

$ git pull
error: Pulling 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.  

対応策

ローカルの変更は破棄して、リモートリポジトリの変更を取り込むようにした。

$ git fetch --all
$ git reset --hard origin/master

参考サイト

# git pullでのエラーと対処法

⚠️ **GitHub.com Fallback** ⚠️