본문 바로가기

Git

[Git] git push 에러 fatal: The current branch main has no upstream branch.

현상

 

git push 가 안된다.

 

에러코드

 

fatal: The current branch main has no upstream branch.

 이런 메세지가 떳다

 

해결

오류의 원인은 처음 만들고 원격 저장소에 대한 기본 브랜치 설정을 안 해줬기 때문입니다.

이런 오류는 처음 브랜치 설정만 해주면 간단하게 해결이 가능합니다.

 

1) 정확하게 remote 와 branch를 입력해 주거나

git push origin main

2) default 설정을 해준다.

$ git push --set-upstream origin main

 

 

https://healthcoding.tistory.com/18

 

[Git] 깃 오류 해결 fatal: The current branch master has no upstream branch.To push the current branch and set the remote a

안녕하세요~ 헬창코딩입니다. 깃을 처음 설치하고 로컬 저장소와 원격 저장소를 만들어서 푸시 테스트할 때 가끔 이런 메시지를 볼 수 있습니다. $ git push fatal: The current branch master has no upstream br.

healthcoding.tistory.com