profile image

L o a d i n g . . .

해결 방법

  1. `force push`를 사용할 수 있다면 적용하기
  2. 1번이 껄끄럽다면 default 브랜치명을 변경하기

문제 해결 흐름

Udemy Business에서 Master Spring 강의 수강중인데 IDE를 Eclipse 중이다.

commit하고 push 했더니 기본 브랜치가 master로 되어있는 바람에 오류가 발생했다.

default 브랜치명을 바꿀까 하다가 어차피 혼자 작업중이니 force push로 해결하기로 했다.

 

프로젝트 우클릭 -> Properties -> Resource의 Location 이 프로젝트가 저장되어 있는 절대 주소 위치니까 git bash에서 checkout 하기 전에 해당 프로젝트 주소로 먼저 들어가자.

cd {프로젝트 절대 주소 및 저장된 폴더 주소}
git checkout master
git branch main master -f
git checkout main
git push origin main -f

출처

1. https://kijuk.tistory.com/146https://codingdiary99.tistory.com/5

2. https://coding-factory.tistory.com/716

복사했습니다!