본문 바로가기
SCM(형상 관리)/VCS | Git(GitHub)

[1분만에 해결하는 Git 오류] fatal: refusing to merge unrelated histories

by 카랑현석 2024. 12. 11.

문제 상황

git push나 git pull 명령 시 fatal: refusing to merge unrelated histories 오류가 발생한다.



문제 원인

git에서는 서로 관련 기록이 없는 이질적인 두 프로젝트를 병합할 때 기본적으로 거부한다.

--allow-unrelated-histories 옵션을 사용하여 이를 강제로 허용해주어야 한다.

 

문제 해결

git pull 명령 뒤에 --allow-unrelated-histories 옵션을 추가해준다.

git pull origin 브랜치명 --allow-unrelated-histories