[Git hub_에러 해결] fatal: The current branch master has no upstream branch.To push the current branch and set the remote as upstream

소영데이(So-young day)·2022년 9월 21일
0

Git gub

목록 보기
2/2
post-thumbnail
  • 캡쳐를 못해서 우선 같은 현상이 일어난 블로그를 참고하여 작성하였다.

[문제의 에러]

$ git push
fatal: The current branch master has no upstream branch.
To push. the current branch and set the remote as upstream, use
     git push --set-upstream origin marster

[Error 1] 브랜치를 master로 언급하여 푸시해도 에러가 발생

$ git push --set-upstream origin marster

이 에러의 원인은 원격저장소에 대한 브랜치 설정이 안되어있기 때문에 그런 것이다.
깃에서 제시해준 해결방법을 그대로 사용하면 대체로 해결이 된다.

$ git push origin master
Enumerating objects: 35, done.
Counting objects: 100% (35/35), done.
Delta compression using up to 8 threads
Compressing objects: 100% (19/19), done.
Writing objects: 100% (25/25), 539.61 KiB | 23.46 MiB/s, done.
Total 25 (delta 2), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (2/2), completed with 1 local object.
To https://github.com/pythonstrup/Spring-Boot-JPA-Blog.git
   3283fff..56fe365  master -> master

😮‍💨 만약 해결되지 않는다면?

$ git remote -v 

git remote -v 명령을 통해 원격저장소를 불러오기.

$ git remote -v
origin  https://원격저장소_주소.git (fetch)
origin  https://원격저장소_주소.git (push)

그 다음에 git push origin master를 치면 remote -v를 통해 찾은 원격저장소 master 브랜치에 푸시된다.

$ git push origin master

git push에서 에러가 많이 발생한다. (내가)
포기하지 말고 방법을 모색해 보자. 무조건 찾아진다.
잠시나마 git hub와 멀어질 뻔했던 나에게 하는 편지이다.
또 에러가 발생하면 내가 이 글을 내가 보기 바란다.
포기하지 마! : )

profile
WEB Publisher & Designer

0개의 댓글