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
相关推荐
lpfasd12318 小时前
git-团队协作基础
chrome·git·elasticsearch
John Song21 小时前
git多个账号管理
git·github
CV_J21 小时前
解决Git 冲突后本地提交丢失/未推送问题
git
__Witheart__21 小时前
Git 某个分支恢复到某个特定的 commit 状态
git
XU磊2601 天前
Git 实现github仓库管理-删除指定目录下的所有文件并保留目录结构
git·github
zhimingwen1 天前
解决 GitLab Token 轮换后 SourceTree 认证失败问题
git
昵称是6硬币1 天前
代码管理——VS Code|Git
git·代码管理
Trouville011 天前
如何在VScode环境下使用git进行版本控制,并上传到gitee远程仓库
ide·git·vscode
weixin_423391931 天前
从开发到合并:AICR 项目 Git 协作提交全流程指南
git
paishishaba1 天前
Git常用命令大全及提交推送详解
git