본문 바로가기
사이드 프로젝트/Error해결

[branch 변경 에러] git push --set-upstream origin main

by 코딩맛집 2023. 1. 9.

[에러]

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

To have this happen automatically for branches without a tracking
upstream, see 'push.autoSetupRemote' in 'git help config'.

 

[해결]

git push --set-upstream origin main

 

[상황]

프로젝트 branch사용하다가 오랜만에 코테 공부한 거 git에 올리려는데

코테 branch랑 프로젝트 branch랑 다르니까 사용할 main branch 바꿔주라는 얘기다.