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
相关推荐
拼图2099 小时前
Git常用语法
分布式·git·学习
ShineWinsu16 小时前
对于Git:基础操作的超详细保姆级解析
linux·c++·git·面试·备份·管理·版本控制器
沉迷...17 小时前
Git skip-worktree 使用笔记(本地忽略配置文件)
javascript·git
解道Jdon19 小时前
JDK 27发布:紧凑对象头、G1默认、量子安全TLS
ide·windows·git·svn·eclipse·github·visual studio
天天喝旺仔1 天前
Git 内部原理深度解析:从 blob/tree/commit 对象到 packfile 与垃圾回收
数据结构·数据库·git·算法·哈希
艾莉丝努力练剑1 天前
【Git:综合复盘】Git 原理与使用
大数据·人工智能·git·elasticsearch·面试
ShineWinsu2 天前
对于Git:远程操作的超详细保姆级解析
linux·git·gitee·github·远程仓库·分布式版本控制系统·远程操作
梦帮科技2 天前
从 Guest 到 Platinum:Prompt 配额、API Key 与访问控制的安全闭环
javascript·git·架构·node.js·reactjs·html5·visual studio
zho_uzhou3 天前
Git入门概念
git
爱奥尼欧3 天前
【Git】远程分支删了本地还在、两个分支历史不相干?两招故障排解
开发语言·git