개발

[git] 에러 해결 - fatal: refusing to merge unrelated histories

soohkang 2021. 2. 18. 12:01
728x90
fatal: refusing to merge unrelated histories


git pull origin master --allow-unrelated-histories 로 해결

 

진유림님 책 처음부터 다시 보면서 따라하고있는데,

고양이 폴더는 윈도우 컴으로 폴더를 만들어서 깃허브에 올려두었고,

문어 폴더는 맥 컴으로 폴더를 만들어서 pull 당겨보는 상황이었다.

맥 컴퓨터에서 git pull origin master를 입력하니 fatal: refusing to merge unrelated histories 에러가 발생한 것이다.

 

구글에 검색해보니 관련성이 없는 프로젝트일 경우 깃에서는  기본적으로 병합을 하지 않는다고한다.

관련성이 없다?? 원격 저장소 주소를 당겨받아 README.txt 파일을 수정하였는데 관련성이 없다는 말을 이해하기 어려웠는데 이에 대해서 설명해준 고마운 블로그가 있어 아래에 링크를 걸어두었다.

 

jobc.tistory.com/177

 

git push, pull (fatal: refusing to merge unrelated histories) 에러

원격 저장소를 remote로 설정하고 바로 push를 하면 몇가지 오류가 발생할 수도 있다. 예를 들어 아래와 같은 오류 메시지이다. 1 2 ! [rejected] master -> master (non-fast-forward) error: failed to push som..

jobc.tistory.com