본문 바로가기

문제 해결

fatal: No configured push destination. 에러 해결

 

fatal: No configured push destination. 에러 해결

 

 

프로젝트를 생성 후 처음으로 git push 를 했는데 해당 에러가 발생했다.

fatal: No configured push destination.
Either specify the URL from the command-line or configure a remote repository using

    git remote add <name> <url>

and then push using the remote name

    git push <name>

 

어떤 에러인가 했더니... 현재 위치의 폴더가 github의 원격 레파지토리와 연결이 되어있지 않다는 듯 하다.

그리고나서 생각해보니 github에서 해당 프로젝트 레파지토리를 생성만 해두고 연결을 해두지 않았었다. ^^;

 

그래서 아무런 커밋이 되어있지 않은 내 github 레파지토리를 가보았더니 어떻게 해야할지에 대한 설명도 나와있었다.

git remote add origin https://깃허브 주소
git branch -M main
git push -u origin main

 

위 순서대로 하니 에러가 나지 않고 잘 push 가 되었다!

항상 처음 프로젝트를 생성하면 레파지토리부터 연결해서 에러가 난 적이 없었는데...

이렇게 하나 더 배워가는구나

 

끝!