git 오류 알림: failed to push some refs to'[email protected]:

1746 단어 git
오늘 Git을 다시 설치하여 Github에 원격 전송하는 테스트를 진행했습니다. GitHub에 있는 저장소는 존재하고 원격 전송 시 다음과 같은 오류가 발생합니다.
$ git push -u origin master
To [email protected]:xxx/xxx.git
 ! [rejected]        master -> master (fetch first)
error: failed to push some refs to '[email protected]:xxx/xxx.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.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

당황하지 마세요. 원격 라이브러리에 있는 파일이 다운로드되지 않았기 때문입니다.그래서 먼저 운행해야 돼요.
 git pull origin master  

그리고 원격 파일이 프로젝트에 다운로드되어 자동으로 통합되는 것을 보았습니다.
그리고 로컬 라이브러리에 새 파일을 추가하고 제출해야 합니다.
그리고 실행하세요.
    git push -u origin master. 

, 문제 해결!!!

좋은 웹페이지 즐겨찾기