[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
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 地球OL攻略 —— 某应届生求职总结
· 提示词工程——AI应用必不可少的技术
· Open-Sora 2.0 重磅开源!
· 周边上新:园子的第一款马克杯温暖上架