GIT无法push

报错

To https://gitee.com/xrw0616/back-end-of-western-restaurant.git

! [rejected] wxr -> wxr (fetch first)

error: failed to push some refs to 'https://gitee.com/xrw0616/back-end-of-western-restaurant.git'

hint: Updates were rejected because the remote contains work that you do not

hint: have locally. This is usually caused by another repository pushing to

hint: the same ref. If you want to integrate the remote changes, use

hint: 'git pull' before pushing again.

hint: See the 'Note about fast-forwards' in 'git push --help' for details.

bash 复制代码
cd 你的文件夹路径
git init

先把东西提交到暂存区,然后提交

bash 复制代码
git add .
git commit -m "提交信息"

我强行推送到了分支

bash 复制代码
git push origin wxr:wxr --force

**问题二:**gitee无法自动合并分支

切换到主分支

bash 复制代码
git checkout master

然后从xx分支拉取

bash 复制代码
 git pull https://gitee.com/xxx/xxx.git wxr

然后从xx分支拉取

bash 复制代码
 git pull https://gitee.com/xrw0616/back-end-of-western-restaurant.git wxr

最后强行合并

bash 复制代码
git push origin master --force
相关推荐
习惯就好zz3 小时前
Git 交互式 rebase 实战:将后续修改合并到历史提交
git
南棱笑笑生9 小时前
20260429给万象奥科的开发板HD-RK3576-PI适配瑞芯微原厂的Android14时删除全部的.git目录
git·rockchip
tsyjjOvO10 小时前
【Git 从入门到实战】(IDEA+Gitee 版)
git·gitee·idea
你知道“铁甲小宝”吗丶12 小时前
git推送到多平台(gitee/github)
git·gitee·github
bksczm12 小时前
Linux之基础开发工具之git
git
GUET_一路向前12 小时前
【git工作常用指令】
大数据·git·elasticsearch
handler0112 小时前
Git 核心指令速查
linux·c语言·c++·笔记·git·学习
二宝哥13 小时前
大数据之yum安装git
git
牛奶咖啡1314 小时前
Git实践——git远程仓库操作
git·git远程仓库的创建·github创建仓库·git将本地仓库推送到远程仓库·使用git克隆远程仓库到本地·git分支的创建与合并·git冲突的产生与解决
随风,奔跑14 小时前
Git学习笔记
笔记·git·学习