Git提交失败之 Updates were rejected because the tip of your current branch is behind

在尝试将本地Git项目推送到GitHub时遇到'Updates were rejected because the tip of your current branch is behind'的错误。错误发生在关联远程仓库并尝试push时,由于本地分支未同步最新远程代码。解决方案包括使用带参数的git pull或先fetch再merge。
摘要由CSDN通过智能技术生成

错误显示

在这里插入图片描述

D:\devworkspace\ecpphoton\jcodef>git push
To https://github.com/osxm/jcodef.git
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'https://github.com/osxm/jcodef.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

错误产生过程

笔者在github上创建一个repository, 之后和本地的路径关联后提交代码出现以上错误。具体过程如下:

  1. 在 Github的页
评论 9
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

oscar999

送以玫瑰,手留余香

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

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

打赏作者

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

抵扣说明:

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

余额充值