在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