Updates were rejected because the tip of your current branch is behind

Git在push推送时,报错提示信息如下:

bash 复制代码
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

解决方法:

1、先使用pull命令:

复制代码
git pull --rebase origin master

2、再使用push命令

复制代码
git push -u origin maste
相关推荐
敲敲敲-敲代码3 小时前
git安装记录
git
我是人✓3 小时前
Git入门:从零开始掌握分布式版本控制
分布式·git
Aurora_eye5 小时前
Git 笔记
笔记·git
解道Jdon5 小时前
FigCraft把Figma用Rust从零重写了一遍
ide·windows·git·svn·eclipse·github·visual studio
橙橙笔记7 小时前
QT安卓软件的制作
android·git·qt·软件
我是人✓8 小时前
Git远程协作与标签管理全攻略
git
闰土_RUNTU8 小时前
Git实用手册(持续更新)
git
Shaoshing9 小时前
ggggggggit
git
Lucky GGBond9 小时前
解决 Git 推送报错:Could not resolve host 及 DNS 劫持排查指南
git
川石课堂软件测试9 小时前
自动化测试|持续集成Git使用详解
git·python·jmeter·mysql·ci/cd·容器·kubernetes