git push -u origin master 오류 해결
2665 단어 소프트웨어 플랫폼
git push - u orrgin master 오류 해결
오류 프롬프트: To github.com:PorterLi/myDataStructCode.git
! [rejected] master -> master (fetch first)
error: failed to push some refs to '[email protected]:PorterLi/myDataStructCode.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 。
해결 방법:
1.gitadd와gitcommit를 이용하여 로컬 임시 저장소의 내용을 창고에 추가
2.gitstatus 로컬 창고 내용을 보면 다음과 같이 3단계를 진행할 수 있습니다 $ git status
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working tree clean
3. 명령은 다음과 같다. 두 창고를 합친다.git pull --rebase origin master
To github.com:PorterLi/myDataStructCode.git
! [rejected] master -> master (fetch first)
error: failed to push some refs to '[email protected]:PorterLi/myDataStructCode.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 。
$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working tree clean
git pull --rebase origin master