본문 바로가기
카테고리 없음

fatal: refusing to merge unrelated histories 해결 방법

by yenua 2022. 3. 13.
반응형

git을 잘못사용하여 branch에 main과 master 이렇게 2개가 생겨버렸고, 이를 merge 하려하니 아래와 같은 에러가 발생하였다.

 

fatal: refusing to merge unrelated histories

 

아래 링크를 통해 해결하였다. 

https://www.educative.io/edpresso/the-fatal-refusing-to-merge-unrelated-histories-git-error

 

요약하자면 main에 해당하는 내용이 있는 상태에서 아래 명령어로 master의 내용들을 pull 하고 다시 push해주었다. 

git pull origin master --allow-unrelated-histories
반응형