git push
시 다음과 같이 에러가 날 경우
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 behind
hint: 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.
push
전에 pull
을 진행해주어야 한다. 하지만
fatal: refusing to merge unrelated histories
다음과 같은 에러가 날 경우
git pull main 브런치명 --allowed-unrelated-histories
를 입력
--allowed-unrelated-histories
이 명령 옵션은 이미 존재하는 두 프로젝트의 기록(history)을 저장하는 드문 상황에 사용된다고 한다. 즉, git에서는 서로 관련 기록이 없는 이질적인 두 프로젝트를 병합할 때 기본적으로 거부하는데, 이것을 허용해 주는 것이다.