當(dāng)我們使用git操作向遠(yuǎn)程倉庫push代碼時(shí),可能會(huì)報(bào)錯(cuò):
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.
主要原因如下:文章來源:http://www.zghlxwxcb.cn/news/detail-757398.html
???????這個(gè)錯(cuò)誤信息通常是由于遠(yuǎn)程倉庫包含了本地倉庫中沒有的工作,而導(dǎo)致的推送失敗。這往往是因?yàn)槠渌嗽谕环种系男薷谋煌扑偷搅诉h(yuǎn)程倉庫中,但是本地倉庫還沒有同步這些修改,因此我們需要先拉取最新的遠(yuǎn)程修改,再嘗試推送。具體操作步驟如下:
1.使用命令git?pull?origin?master(這里的origin是提前添加的遠(yuǎn)程倉庫地址別名,相關(guān)命令為 git remote add origin https//....),將遠(yuǎn)程最新的工作合并到本地倉庫,并解決任何沖突。
2.再次嘗試使用命令git?push,推送更新到遠(yuǎn)程倉庫。
注意,如果遠(yuǎn)程更改與本地更改有沖突,則需要先解決沖突后再推送。文章來源地址http://www.zghlxwxcb.cn/news/detail-757398.html
到了這里,關(guān)于git使用push命令報(bào)錯(cuò)-error: failed to push some refs to ‘https://gitee.com/MFLU/graduation_design.git‘的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!