如何解决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/freamwork
   2794f0d..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 clean

jinshu@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.git
   70c25c6..1cd4207  faceIdentify -> faceIdentify
Branch 'faceIdentify' set up to track remote branch 'faceIdentify' from 'origin'.

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

想养一只!

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值