인프라와 배포 › Git

git 에러 모음: refusing to merge unrelated histories

목차

fatal: refusing to merge unrelated histories

증상

  1. git push가 안 된다.

해결

  1. push 전에 먼저 pull을 해서 프로젝트를 병합해 주어야 한다.

  2. pull 명령 실행 시 이런 문구와 함께 진행되지 않는다면, 다음의 명령으로 실행한다.

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

# --allow-unrelated-histories
# 서로 관련 기록이 없는 이질적인 두 프로젝트를 병합할 때 기본적으로 거부하는데, 이것을 허용해 주는 것이다.