refusing to merge unrelated histories

KimHyunKi·2020년 8월 12일
0

Git

목록 보기
2/3

git push 를 통해 원격저장소에 최종적으로 업데이트를 할 때 정상적으로 수행되지 않고 pull을 하라는 때가 있다.

error: failed to push some refs to 'https://github.com/~'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

그래서 git pull을 하면

fatal: refusing to merge unrelated histories

합병을 할 수 없다고 나온다.
이럴때 강제로 pull하는 명령어

git pull origin [branch] --allow-unrelated-histories

후에 git status로 상태에 따라 조치를 취하면 된다.

profile
Developer

0개의 댓글