Git push 해결 중 error: failed to push some refs to...
2052 단어 개발 도구
$ git push origin master
To github.com:xiaoyangLee/LearnJava.git
! [rejected] master -> master (fetch first)
error: failed to push some refs to '[email protected]:xiaoyangLee/LearnJava.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.
원격 창고의 파일과 로컬 창고의 차이가 있기 때문입니다. 예를 들어 원격 창고에 파일Readme가 있습니다.md, 그러나 로컬 창고가 없으면 이런 상황이 발생할 수 있습니다.
이런 상황이 발생한 이유는 다양하다. 예를 들어github로 파일을 업로드했거나 나처럼 이번에는 다른 시스템으로 파일을 전송해서 문제가 생겼다.해결 방법은 분명히 있습니다. 로컬 창고를 삭제하고gitclone을 하나 더 사용하지만, 이런 방법은 분명히 취할 수 없습니다.
해결 방법:gitpull로 지점 합병
git pull --rebase origin master
gitpull 명령은 다른 저장소나 로컬 지점에서 가져와 통합하고 원격 호스트의 특정한 지점의 업데이트를 가져와 로컬 지정한 지점과 통합하는 데 사용됩니다.
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
git push 오류 ERROR: missing commit message footer에서 변경-ID전체 오류 로그는 다음과 같습니다. 오류 프롬프트에서 Change-Id를 잃어버려서 오류의 원인을 알 수 없습니다. 문제 해결 단계는 다음과 같습니다. 1. Hint 프롬프트에 따라 명령을 실행합니다. 2, 그리고 ...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.