git本地仓库上传远程仓库发生报错的解决方法
目录
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,然后退出即可
之后重新打开bash,依次执行以下指令即可:
git add .
git commit -m "你的注释"
git push -u origin [你的分支]
原文地址:https://blog.csdn.net/csdn3043663729/article/details/143699925
免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!