-
Git push가 안되는 경우 (fatal: refusing to merge unrelated histories)IT, 프로그래밍/버전관리시스템(Git) 2018. 7. 13. 13:51
로컬 저장소에 있는 프로젝트를 깃허브 사이트를 통해 만든 저장소로 push 하는 경우에 이런 메세지가 뜨는 경우가 있다.
12345678C:\Users\gitProject>git push origin masterTo https://github.com/userId/userProject.git! [rejected] master -> master (non-fast-forward)error: failed to push some refs to 'https://github.com/userId/userProject.git'hint: Updates were rejected because the tip of your current branch is behindhint: its remote counterpart. Integrate the remote changes (e.g.hint: 'git pull ...') before pushing again.hint: See the 'Note about fast-forwards' in 'git push --help' for details.cs push 전에 먼저 pull을 해서 프로젝트를 병합해 주어야 한다.
1refusing to merge unrelated historiescs pull 명령 실행시 이런 문구와 함께 진행되지 않는다면, 다음의 명령으로 실행한다.
1git pull origin 브런치명 --allow-unrelated-historiescs --allow-unrelated-histories 이 명령 옵션은 이미 존재하는 두 프로젝트의 기록(history)을 저장하는 드문 상황에 사용된다고 한다. 즉, git에서는 서로 관련 기록이 없는 이질적인 두 프로젝트를 병합할 때 기본적으로 거부하는데, 이것을 허용해 주는 것이다.
'IT, 프로그래밍 > 버전관리시스템(Git)' 카테고리의 다른 글
Git 기초 정리 잘 된 포스팅 (0) 2018.10.07 Egit pull/push 시에 pom.properties 파일 conflict 문제 (0) 2018.10.02 Spring-Git 연동 (0) 2018.07.13