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

小鱼儿 2022-12-14 08:54 242阅读 0赞

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

  1. jinshu@DESKTOP-L5OTKGN MINGW32 /c/jinshu/develop/projects/freamwork (faceIdentify)
  2. $ git push origin faceIdentify
  3. To http://192.168.88.98/project/freamwork.git
  4. ! [rejected] faceIdentify -> faceIdentify (fetch first)
  5. error: failed to push some refs to 'http://192.168.88.98/project/freamwork.git'
  6. hint: Updates were rejected because the remote contains work that you do
  7. hint: not have locally. This is usually caused by another repository pushing
  8. hint: to the same ref. You may want to first integrate the remote changes
  9. hint: (e.g., 'git pull ...') before pushing again.
  10. hint: See the 'Note about fast-forwards' in 'git push --help' for details.

出现该错误的原因具体我也不太清楚,也没有仔细研究,当出现该错误时,可以使用git pull命令,然后再按照流程提交一遍即可。

  1. //**先使用git pull 命令**
  2. jinshu@DESKTOP-L5OTKGN MINGW32 /c/jinshu/develop/projects/freamwork (faceIdentify)
  3. $ git pull
  4. remote: Enumerating objects: 4, done.
  5. remote: Counting objects: 100% (4/4), done.
  6. remote: Compressing objects: 100% (3/3), done.
  7. remote: Total 3 (delta 0), reused 0 (delta 0)
  8. Unpacking objects: 100% (3/3), 9.03 KiB | 1.00 MiB/s, done.
  9. From http://192.168.88.98/project/freamwork
  10. 2794f0d..70c25c6 faceIdentify -> origin/faceIdentify
  11. Merge made by the 'recursive' strategy.
  12. face.sql | 532 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  13. 1 file changed, 532 insertions(+)
  14. create mode 100644 face.sql
  15. //**重新提交一遍**
  16. jinshu@DESKTOP-L5OTKGN MINGW32 /c/jinshu/develop/projects/freamwork (faceIdentify)
  17. $ git status
  18. On branch faceIdentify
  19. Your branch is ahead of 'origin/faceIdentify' by 2 commits.
  20. (use "git push" to publish your local commits)
  21. nothing to commit, working tree clean
  22. jinshu@DESKTOP-L5OTKGN MINGW32 /c/jinshu/develop/projects/freamwork (faceIdentify)
  23. $ git add .
  24. jinshu@DESKTOP-L5OTKGN MINGW32 /c/jinshu/develop/projects/freamwork (faceIdentify)
  25. $ git commit -m "merge"
  26. On branch faceIdentify
  27. Your branch is ahead of 'origin/faceIdentify' by 2 commits.
  28. (use "git push" to publish your local commits)
  29. nothing to commit, working tree clean
  30. g
  31. jinshu@DESKTOP-L5OTKGN MINGW32 /c/jinshu/develop/projects/freamwork (faceIdentify)
  32. $ git push -u origin faceIdentify
  33. Enumerating objects: 60, done.
  34. Counting objects: 100% (43/43), done.
  35. Delta compression using up to 4 threads
  36. Compressing objects: 100% (16/16), done.
  37. Writing objects: 100% (24/24), 2.83 KiB | 723.00 KiB/s, done.
  38. Total 24 (delta 10), reused 0 (delta 0)
  39. To http://192.168.88.98/project/freamwork.git
  40. 70c25c6..1cd4207 faceIdentify -> faceIdentify
  41. Branch 'faceIdentify' set up to track remote branch 'faceIdentify' from 'origin'.

发表评论

表情:
评论列表 (有 0 条评论,242人围观)

还没有评论,来说两句吧...

相关阅读