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
相关推荐
abcnull35 分钟前
github开源协议选择
git·github·开源协议
安庆平.Я3 小时前
git互联GitHub 使用教程
git·github
自来也_9 小时前
Git配置代理
git
Jooolin1 天前
【编程史】Git是如何诞生的?这可并非计划之中...
linux·git·ai编程
Lw老王要学习1 天前
VScode 使用 git 提交数据到指定库的完整指南
windows·git·vscode
去旅行、在路上1 天前
Git & Svn
git·svn
abcnull1 天前
github中main与master,master无法合并到main
git·github
养意1 天前
git提交代码和解决冲突修复bug
git·bug
码农黛兮_462 天前
Git 常用命令大全
git
一弓虽2 天前
git 学习
git·学习