현상
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
'Git' 카테고리의 다른 글
[Git] git remote add origin 삭제하기 (0) | 2022.02.26 |
---|---|
[Git] 커밋 메시지 작성법 (0) | 2022.02.23 |
[Git] git 최초설정, 사용자 이름과 이메일 입력하기 git config (0) | 2022.02.22 |
[Git] git init, git status (0) | 2022.02.22 |
[Git] origin,remote 의미 (0) | 2022.02.22 |