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
相关推荐
大飞pkz4 小时前
【Git】git lfs自动跟踪大文件
git·lfs·git lfs·大文件传入github·lfs大文件自动跟踪
自学也学好编程4 小时前
Git分支管理与工作流详解
git
自学也学好编程6 小时前
Git基础概念与常用命令详解
git
linrunxinnn10 小时前
Git 团队协作总结 —— 不只是版本控制的工具
git
吱吱02号机13 小时前
<Git>从零创建远程新仓库(最小操作)
git
测试开发技术1 天前
使用 Git 时出现 unable to access,如何解决?
git·面试题
zhougl9961 天前
git项目,有idea文件夹,怎么去掉
java·git·intellij-idea
tmacfrank2 天前
Git 使用技巧与原理(一)—— 基础操作
git
dilvx2 天前
git 配置 default editor
git
特种加菲猫2 天前
构建完整工具链:GCC/G++ + Makefile + Git 自动化开发流程
linux·笔记·git·自动化