같은 브랜치에서 작업하거나, 같은 레포에서 작업했음에도 관계 없는 저장소라 pull, push, merge가 안될 수 있다.
README를 작성하면 일어날 수 있는 일이다.
A<-B 브랜치로 강제로 병합하는 방법.
git merge --allow-unrelated-histories B
merge 위치에 pull을 넣으면 강제로 pull 할 수 있다.
왜 README를 작성하면 이런 일이 발생하는지 설명해놓은 블로그다.
git push, pull (fatal: refusing to merge unrelated histories) 에러
원격 저장소를 remote로 설정하고 바로 push를 하면 몇가지 오류가 발생할 수도 있다.예를 들어 아래와 같은 오류 메시지이다.12 ! [rejected] master -> master (non-fast-forward)error: failed to push some refs to 'https:
jobc.tistory.com
'git, github' 카테고리의 다른 글
[git] failed to push some refs to + 레포 주소 error (0) | 2024.06.03 |
---|---|
github 레포지토리 갱신하기 (0) | 2024.04.01 |
Repository 강제 push (0) | 2024.03.14 |
원격 저장소 연결 및 연결 끊기 (0) | 2024.03.08 |
[git, github] 협업 관리하기 (0) | 2024.01.11 |