우당탕탕 개발일기

[git] master -> main 병합하기 본문

What I Learned/etc.

[git] master -> main 병합하기

rilee 2022. 12. 12. 11:09
728x90

개인적인 프로젝트를 위해 세팅하던 중 main 브랜치가 있는데

연동하는 과정에서 master라는 브랜치가 생겼고 세팅한 환경들은 죄다 master에 커밋된 상황.

분명 브랜치의 내용이 다른데 무슨 일인지 master -> main으로 PR이 보내지지 않았다.

 

 

 

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

 

위의 명령을 실행시키면 master는 그대로 남아있지만, main에 master의 내용들이 커밋 되었다.

그냥...master의 내용을 강제로 푸쉬시키는 명령어인 듯 하다.

 

출처 : https://velog.io/@lecharl/master-main-%EA%B0%95%EC%A0%9C-%EB%B3%91%ED%95%A9

 

master -> main 강제 병합?

"There isn't anything to compare. Nothing to compare, branches are entirely different commit histories"위와 같은 문제 해결출처: master -> main알고보니 master에 있는 걸

velog.io

 

728x90