sky_cheng

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
统计
 
复制代码
[root@localhost newccdeploy]# git push
Username for 'https://172.28.17.127': xxxx
Password for 'https://xxxxx@172.28.17.127': 
To https://172.28.17.127/pmc/Operations/newccdeploy.git
 ! [rejected]        main -> main (non-fast-forward)
error: failed to push some refs to 'https://172.28.17.127/pmc/Operations/newccdeploy.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. If you want to integrate the remote changes,
hint: use 'git pull' before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
复制代码

是由于本地和远程仓库两者代码文件不同步,因此需要先pull,进行合并然后再进行push

一、先使用pull --rebase,拉取远程仓库文件同步到本地,--rebase参数将当前分支的更改重新应用到获取的最新提交上

[root@localhost newccdeploy]# git pull --rebase origin
Username for 'https://172.28.17.127': xxxxx
Password for 'https://xxxx@172.28.17.127': 
Successfully rebased and updated refs/heads/main.

二、再使用push,更新远程仓库

复制代码
[root@localhost newccdeploy]# git push origin         
Username for 'https://172.28.17.127': xxxxx
Password for 'https://xxxxx@172.28.17.127': 
Enumerating objects: 17, done.
Counting objects: 100% (17/17), done.
Delta compression using up to 8 threads
Compressing objects: 100% (10/10), done.
Writing objects: 100% (11/11), 2.00 KiB | 511.00 KiB/s, done.
Total 11 (delta 7), reused 0 (delta 0), pack-reused 0
To https://172.28.17.127/pmc/Operations/newccdeploy.git
   0de9b08..f3136c3  main -> main
复制代码

 

posted on   sky_cheng  阅读(102)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 地球OL攻略 —— 某应届生求职总结
· 提示词工程——AI应用必不可少的技术
· Open-Sora 2.0 重磅开源!
· 周边上新:园子的第一款马克杯温暖上架
 
点击右上角即可分享
微信分享提示