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
相关推荐
认真敲代码的小火龙1 分钟前
git入门
git
写bug如流水1 小时前
【Git】Git Commit Angular规范详解
前端·git·angular.js
wang_book8 小时前
Gitlab学习(007 gitlab项目操作)
java·运维·git·学习·spring·gitlab
不是笨小孩i11 小时前
Git常用指令
大数据·git·elasticsearch
救救孩子把11 小时前
mac中git操作账号的删除
git·macos
汀、人工智能13 小时前
报错error: RPC failed,curl 16 Error in the HTTP2 framing layer解决方法
网络·git·网络协议·rpc
Eoneanyna14 小时前
QT设置git仓库
开发语言·git·qt
+码农快讯+14 小时前
Git入门学习(1)
git·学习·elasticsearch
VaporGas18 小时前
idea集成和使用Git指南
java·git·intellij-idea
无名之逆19 小时前
计算机专业的就业方向
java·开发语言·c++·人工智能·git·考研·面试