git repository 새로 생성 해서 첫 push 를 하는 도중 발생한 오류이다
야호 push는 너무 잘 됐다
이제 github에서 Compare & pull request 하려고 보니
"There isn't anything to compare. Nothing to compare, branches a
re entirely different commit histories"
...왜 없어?
알고보니까 GitHub에서 default 브랜치를 'master' 브랜치로 사용하다가, 'main' 브랜치로 이름을 변경 했다.
원래라면 'master' 브랜치에서 'develop' 브랜치 땄어야되는 건데,
아무것도 없는 상태에서 처음 'develop' 브랜치를 생성하고 그 브랜치에 push 하는 과정에서
아예 다른 히스토리로 잡혔기 때문에 저 에러가 나오는 것이다.
만약 -f 옵션으로 브랜치를 강제로 해도 된다면,
git checkout master
git branch main master -f
git checkout main
git push origin main -f
이렇게 하면 된다.
'Git & GitHub' 카테고리의 다른 글
github 잔디 안 심어짐 및 이미 커밋한 내용 잔디 심기 (0) | 2024.11.01 |
---|---|
[Git] 원격 repository 연결 및 commit (0) | 2024.10.25 |
댓글