해결 방법:error:failed to push some refs to'https://github.com/xxxx.git‘

1568 단어 Git
로컬 창고에서push로 원격 창고로 가는 중 오류가 발생했습니다.
fengxun@DESKTOP-GL9HQRU MINGW64 /d/GitWorkSpace (master)
$ git push origin master
To https://gitee.com/woshifanlan/git_study.git
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'https://gitee.com/woshifanlan/git_study.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

원인: 오류가 발생한 주요 원인은gitee의 README입니다.md 파일이 로컬 코드 디렉터리에 없으면 다음 명령을 통해 코드 통합을 할 수 있습니다
git pull --rebase origin master

입력
git push origin master   # gitee

좋은 웹페이지 즐겨찾기