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
相关推荐
~央千澈~2 小时前
实战针对本地项目git如何移除旧仓库关联并且添加关联新仓库-优雅草卓伊凡
git
JH30739 小时前
git常用命令大全
git
ll57764433215 小时前
使用PyTorch实现自定义损失函数以FocalLoss为例的详细教程
git
李少兄16 小时前
Git 用户名与邮箱配置指南
git
Blue啊17 小时前
code Merge(qcc)
git·gitlab
洛小豆21 小时前
Git打标签仓库看不到?她说:豆子,你又忘了加 --tags!
git·后端·github
好奇的菜鸟1 天前
理解 Git 命令 `git reset --hard origin/pre`:版本回退的“利刃”与使用禁忌
大数据·git
春生野草1 天前
git的使用
git
今天头发还在吗1 天前
解决 Git 推送冲突:使用 Rebase 整合远程更改
大数据·git·elasticsearch
蓝色空白的博客1 天前
Git代码下拉更新推送操作用法整理
git