捉虫记录01-git本地仓库上传远程仓库发生报错的解决方法

目录

1.报错信息

2.原因

3.解决方法


 

1.报错信息

! [rejected] dev-zzh -> dev-zzh (fetch first) error: failed to push some refs to 'https://gitee.com/scau_cz/3-dprinter-lan-bacnkend.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.

2.原因

错误信息表明,当前本地的分支没有包含远程仓库的最新更改,这通常是因为其他人已经推送了他们的更改到同一个分支。

3.解决方法

git pull origin [你的分支名]

如果出现以下问题,只需要加上git pull --no-edit,然后退出即可

cab2688dc1be4dafb8ca4d2e0802aaeb.png

之后重新打开bash,依次执行以下指令即可:

git add .
git commit -m "你的注释"
git push -u origin [你的分支]

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值