友情提醒:
先看文章目錄,大致了解文章知識點結(jié)構(gòu),點擊文章目錄可直接跳轉(zhuǎn)到文章指定位置。
第一章、問題分析
1.1)報錯提示
報錯如下: ! [rejected] master -> master (non-fast-forward) error: failed to push some refs to 'gitxxxxx.test.git' |
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: ‘git pull …’) before pushing again.
翻譯成中文:
提示:更新被拒絕,因為您當(dāng)前分支落后
提示:它的遠(yuǎn)程對應(yīng)項被更改
提示:“git pull…”)然后再次push。
1.2)報錯分析
直接在github上直接向庫中添加文件,但是沒有使用pull對本地庫同步,就push上傳就會提示:”當(dāng)前分支落后“。
第二章、解決方式
2.1)方式1:直接pull
先去將遠(yuǎn)程倉庫的同步到本地,再push
git pull origin master
2.2)方式2:直接pull
①如果依然遇到這個警告,說明你之前commit過了,需要通過–rebase方式將本地的提交暫存起來。同時從遠(yuǎn)程倉庫的master分支拉取最新的提交。
git pull --rebase origin master
②提示成功
③再次push
git push origin master
2.3)方式三
使用 --rebase 還是不行,通過 git status 看一下文章來源:http://www.zghlxwxcb.cn/news/detail-805469.html
git status
提示如果是這樣的:
輸入continue命令繼續(xù):文章來源地址http://www.zghlxwxcb.cn/news/detail-805469.html
git rebase --continue
到了這里,關(guān)于解決git錯誤:error: failed to push some refs to ‘git xxx xxxx‘的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!