반응형
반응형
🚖 Error Hint
Updates were rejected because the remote contains work that you do not have locally. This is usually caused by another repository pushing to the same ref. You may want to first integrate the remote changes (e.g., 'git pull ...') before pushing again. See the 'Note about fast-forwards' in 'git push --help' for details. |
🎃 오류 원인
연동된 git master에서 제대로 commit이 안 되는 경우인데 깃허브에서 저장소를 생성할 때
README.md 생성을 commit 했지만 로컬 저장소에서는 README.md 생성 commit 했다는 것을
인식하지 못했기 때문에 오류가 나는 것
Visual Studio Code terminal에 위와 같은 오류 메시지가 뜰 때 (노란 박스 안에는 깃허브 레파지토리명)
아래 명령문으로 강제 push 시킨다.
이때 -f는 force를 뜻한다.
git push -f origin master
그다음 현재 프로젝트 저장소 및 url을 확인할 수 있는 명령문을 입력하면
origin fetch, push url을 확인할 수 있다.
git remote -v
master 계정으로 커밋을 해보자.
VS Code 좌측 하단의 구름 또는 회전하는 모양의 아이콘을 클릭하면
이런 창이 팝업 되는데 OK를 클릭한 후 깃허브 저장소를 확인하면 제대로 업로드된 것을 알 수 있다.
'Study > ERROR' 카테고리의 다른 글
[MySQL] MySQL Installer 포트번호 설정 시 오류 the specified port already in use (0) | 2020.07.24 |
---|
댓글