github: git push代码出现需要merge

在git push 代码的时候, 出现了提交reject的问题, 原因是没有git pull代码,远程仓库中的代码发生过改变, 没有及时的 pull, 合并到本地仓库, 所以会出现当下的问题…

fengxuewei@fengxuewei-Legion-Y7000-2019-PG0:~/GitHub/uav_project/fixedWing_ws/src$ git push origin Version-1.0 
Username for 'https://github.com': fengxuewei-dev
Password for 'https://fengxuewei-dev@github.com': 
To https://github.com/WangXiman/uav_project.git
 ! [rejected]        Version-1.0 -> Version-1.0 (non-fast-forward)
error: failed to push some refs to 'https://github.com/WangXiman/uav_project.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.

修改的内容比较多, 所以就没有git pull, 直接强制上传

fengxuewei@fengxuewei-Legion-Y7000-2019-PG0:~/GitHub/uav_project/fixedWing_ws/src$ git push origin Version-1.0 -f
Username for 'https://github.com': fengxuewei-dev
Password for 'https://fengxuewei-dev@github.com': 
Counting objects: 9, done.
Delta compression using up to 12 threads.
Compressing objects: 100% (9/9), done.
Writing objects: 100% (9/9), 1.57 KiB | 801.00 KiB/s, done.
Total 9 (delta 6), reused 0 (delta 0)
remote: Resolving deltas: 100% (6/6), completed with 6 local objects.
To https://github.com/WangXiman/uav_project.git
 + c50d434...90b9b75 Version-1.0 -> Version-1.0 (forced update)

当上传的代码的时候,会出现push很慢,但是也会出现push响应一段时间之后,出现了下面的情况

fengxuewei@fengxuewei-Legion-Y7000-2019-PG0:~/c-plus-plus/C++/C-plus-plus-Learning$ git push origin main
fatal: unable to access 'https://github.com/fengxuewei-dev/C-plus-plus-Learning.git/': gnutls_handshake() failed: Error in the pull function.

解决方案:

sudo apt-get -y install build-essential nghttp2 libnghttp2-dev libssl-dev
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值