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
相关推荐
qq_218753313 小时前
常用Git命令
java·git
4277240015 小时前
IDEA使用git不提示账号密码登录,而是输入token问题解决
java·git·intellij-idea
利刃大大1 天前
【Git】五、多人协作
git
逸Y 仙X1 天前
Git常见命令--助力开发
java·大数据·git·java-ee·github·idea
wgslucky1 天前
pipeline 使用git parameter插件实现动态选择分支构造
git
春天姐姐1 天前
vue3项目开发总结
前端·vue.js·git
{⌐■_■}2 天前
【git】工作流实战:从本地仓库到远程仓库,git pull 与git rebase使用讲解,案例解析
git
大溪地C2 天前
Git 合并冲突解决与状态分析笔记
笔记·git
CsbLanca2 天前
Git配置个人和公司的提交信息,通过‘目录配置‘
git
娶个名字趴2 天前
Git企业开发
git