디폴트 브랜치를 main으로 했는데, 디렉토리에서 commit할 때 master로 체크아웃된 상태였다.

그 결과 main branch에 push되지 않고 master 브랜치가 따로 생성된 것을 확인했다.

 

compare and pull request 버튼이 떠서 눌러보면

"main and master are entirely different commit histories" 라고 뜬다.

 

따라서 강제로 브랜치를 옮기는 식으로 해결했다.

 

git checkout master
git branch main master -f
git checkout main
git push origin main -f

 

참고한 블로그 https://kim6394.tistory.com/254

복사했습니다!