[Error]git pull (fatal: refusing to merge unrelated histories)

C____JIN·2022년 4월 23일
0

Error Solution

목록 보기
2/3
post-thumbnail

git pull 할 때 오류 발생

명령어

$ git pull https://github.com/devpcjin/WIL.git main
  • $ git push를 했는데 pull을 먼저 진행하라는 에러 메시지가 발생하여 pull을 하던 중 $ git pull 에서도 다음과 같은 오류가 발생했습니다.

에러 내용

From https://github.com/devpcjin/WIL
 * branch            main       -> FETCH_HEAD
fatal: refusing to merge unrelated histories
  • 서로 관련 없는 저장소를 합칠 때 git이 거부해서 발생한다고 합니다.

해결 방법

$ git pull origin main --allow-unrelated-histories

profile
개발 블로그🌐 개발일지💻

0개의 댓글