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
相关推荐
stevenzqzq4 小时前
git 常用操作
大数据·git
Curvatureflight6 小时前
Git工作流最佳实践:从混乱到优雅
git
wu~9706 小时前
GitHub永不遗忘,使用git push -f来覆盖的提交依旧保留
git·github
Vermouth_008 小时前
git clone的时候提示access denied
git
qq_437657279 小时前
清楚本地的git并重新登录
git
jiang_changsheng9 小时前
工作流agent汇总分析 2
java·人工智能·git·python·机器学习·github·语音识别
顶点多余10 小时前
版本控制器-git
linux·git
夔曦10 小时前
Git工程日常下拉/上传完整流程(自用)
git
岱宗夫up10 小时前
GitHub Desktop如何设置中文?这不是个简单问题
git·github
岱宗夫up13 小时前
.env 文件是干啥的?为什么不能提交到 Git?
大数据·git·elasticsearch·搜索引擎·gitee·github·gitcode