欢迎访问 生活随笔!

生活随笔

当前位置: 首页 >

如何解决error: failed to push some refs to ‘xxx(远程库)‘

发布时间:2025/3/19 36 豆豆
生活随笔 收集整理的这篇文章主要介绍了 如何解决error: failed to push some refs to ‘xxx(远程库)‘ 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

当push代码时,出现如下错误:

jinshu@DESKTOP-L5OTKGN MINGW32 /c/jinshu/develop/projects/freamwork (faceIdentify) $ git push origin faceIdentify To http://192.168.88.98/project/freamwork.git! [rejected] faceIdentify -> faceIdentify (fetch first) error: failed to push some refs to 'http://192.168.88.98/project/freamwork.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 pull 命令** jinshu@DESKTOP-L5OTKGN MINGW32 /c/jinshu/develop/projects/freamwork (faceIdentify) $ git pull remote: Enumerating objects: 4, done. remote: Counting objects: 100% (4/4), done. remote: Compressing objects: 100% (3/3), done. remote: Total 3 (delta 0), reused 0 (delta 0) Unpacking objects: 100% (3/3), 9.03 KiB | 1.00 MiB/s, done. From http://192.168.88.98/project/freamwork2794f0d..70c25c6 faceIdentify -> origin/faceIdentify Merge made by the 'recursive' strategy.face.sql | 532 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++1 file changed, 532 insertions(+)create mode 100644 face.sql//**重新提交一遍** jinshu@DESKTOP-L5OTKGN MINGW32 /c/jinshu/develop/projects/freamwork (faceIdentify) $ git status On branch faceIdentify Your branch is ahead of 'origin/faceIdentify' by 2 commits.(use "git push" to publish your local commits)nothing to commit, working tree cleanjinshu@DESKTOP-L5OTKGN MINGW32 /c/jinshu/develop/projects/freamwork (faceIdentify) $ git add .jinshu@DESKTOP-L5OTKGN MINGW32 /c/jinshu/develop/projects/freamwork (faceIdentify) $ git commit -m "merge" On branch faceIdentify Your branch is ahead of 'origin/faceIdentify' by 2 commits.(use "git push" to publish your local commits)nothing to commit, working tree clean g jinshu@DESKTOP-L5OTKGN MINGW32 /c/jinshu/develop/projects/freamwork (faceIdentify) $ git push -u origin faceIdentify Enumerating objects: 60, done. Counting objects: 100% (43/43), done. Delta compression using up to 4 threads Compressing objects: 100% (16/16), done. Writing objects: 100% (24/24), 2.83 KiB | 723.00 KiB/s, done. Total 24 (delta 10), reused 0 (delta 0) To http://192.168.88.98/project/freamwork.git70c25c6..1cd4207 faceIdentify -> faceIdentify Branch 'faceIdentify' set up to track remote branch 'faceIdentify' from 'origin'.

总结

以上是生活随笔为你收集整理的如何解决error: failed to push some refs to ‘xxx(远程库)‘的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。