Github

[GitHub] error: Pulling is not possible because you have unmerged files 해결 방법

Se Yeon 2022. 9. 27. 16:23

평소처럼 git pull 을 했는데 에러가 발생했다

error: Pulling is not possible because you have unmerged files  와 함께 main 옆에 

| MERGING가 생겼다...


병합되지 않은 파일이 있다니 갑자기 무슨 ㅜㅜ

stackoverflow를 찾아본 결과 , 여러가지의 답변이 있었으나 그중 하나인 해결방법을 적용해보았다.
변경 사항을 병합하지 않고 로컬을 업데이트하려면 다음 코드를 입력하라길래  입력해봤는데 귀신같이 해결됐다..

git reset --hard HEAD

 

HEAD를 사용하여 로컬을 재설정한 다음 git pull을 사용하여 원격을 당기는 코드라고 한다.

만약 이미 병합을 로컬로 커밋했지만 되돌리고싶은 경우에는 다음 코드를 입력하면 된다고 한다.

git reset --hard HEAD~1

 

자세한 내용은 stackoverfolw 링크를 참고하면 될거같다.

 

https://stackoverflow.com/questions/26376832/why-does-git-say-pull-is-not-possible-because-you-have-unmerged-files

 

Why does git say "Pull is not possible because you have unmerged files"?

When I try to pull in my project directory in the terminal, I see the following error: harsukh@harsukh-desktop:~/Sites/branch1$ git pull origin master U app/config/app.php U app/config/database.ph...

stackoverflow.com