VSCode에서 Github 업로드 중 오류1

Talisman·2022년 5월 6일
0

오류 1

error: Unknown subcommand: origin

입력한 명령
git remote origin add https://github.com/ttpoh/exwrite.git

해결 방법1
명령어 수정
git remote add origin https://github.com/ttpoh/exwrite.git

(명령어 입력 시 add와 origin 위치 바뀐 거 수정.)

오류 2

! [rejected] master -> master (fetch first)
error: failed to push some refs to 'https://github.com/ttpoh/exwrite.git'

hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.

입력한 명령
git push origin master

문제 원인
오류에 대한 힌트 4가지 중에 첫 번째 원인.
기존에 업로드 돼 있는 프로젝트에 병합하는 과정에서 충돌.

해결 방법1
git pull origin master --allow-unrelated-histories

--allow-unrelated-histories : 관련 없는(기존 프로젝트) 분기의 프로젝트와 병합할 때 사용하는 명령어

다시 git push origin master 입력

0개의 댓글