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
急速前行Klein4 小时前
Ubuntu中安装git
linux·git·ubuntu
饼干ovo10 小时前
shell编程
java·git·github
bubiyoushang88817 小时前
解决 Git 访问 GitHub 时的 SSL 错误
git·github·ssl
海码00721 小时前
【版本控制】Git 和 GitHub 入门教程
git·github
网硕互联的小客服1 天前
503 Service Unavailable:服务器暂时无法处理请求,可能是超载或维护中如何处理?
服务器·git·github
abcnull1 天前
github开源协议选择
git·github·开源协议
安庆平.Я1 天前
git互联GitHub 使用教程
git·github
自来也_1 天前
Git配置代理
git
Jooolin2 天前
【编程史】Git是如何诞生的?这可并非计划之中...
linux·git·ai编程