日本免费高清视频-国产福利视频导航-黄色在线播放国产-天天操天天操天天操天天操|www.shdianci.com

學(xué)無先后,達(dá)者為師

網(wǎng)站首頁 編程語言 正文

如何解決error: failed to push some refs to 'xxx(遠(yuǎn)程庫)'

作者:大盤雞面排骨面 更新時(shí)間: 2022-11-19 編程語言

在使用 Android Studio 對源代碼進(jìn)行push到碼云時(shí)可出錯(cuò),報(bào)錯(cuò)如下:

15:55:01.129: [fuwandai] git -c core.quotepath=false push --progress --porcelain origin refs/heads/master:master --set-upstream
error: failed to push some refs to 'https://gitee.com/dapanjimianpaigumian/FirstProject.git'
To https://gitee.com/dapanjimianpaigumian/FirstProject.git
! refs/heads/master:refs/heads/master [rejected] (fetch first)
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
Done
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.

出現(xiàn)錯(cuò)誤的主要原因是oschina中的README.md文件不在本地代碼目錄中


可以通過如下命令進(jìn)行代碼合并【注:pull=fetch+merge]

git pull --rebase origin master

執(zhí)行上面代碼后可以看到本地代碼庫中多了README.md文件


此時(shí)再執(zhí)行語句 git push -u origin master即可完成代碼上傳到oschina


原文鏈接:https://blog.csdn.net/zhao_xin_peng/article/details/79378895

欄目分類
最近更新