git - 无法提交我的更改并收到此错误
问题描述
提示:更新被拒绝,因为您当前分支的提示落后于提示:它的远程对应部分。在再次推送之前集成远程更改(例如提示:'git pull ...')。提示:有关详细信息,请参阅“git push --help”中的“关于快进的说明”。
解决方案
如果您看到类似的消息REPOSITORY
- 您的存储库名称和您的USERNAME
并假设master
是当前分支
$ git push origin master
To https://github.com/USERNAME/REPOSITORY.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'https://github.com/USERNAME/REPOSITORY.git'
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes (e.g. 'git pull') before pushing again. See the
'Note about fast-forwards' section of 'git push --help' for details.
然后,您可以执行以下操作:
有人在你最后一次 git fetch 和 git push 之间推送了新的提交。在这种情况下,您需要重复您的步骤和rebase master
一次。
git fetch
git rebase master
git push origin master
推荐阅读
- django - Django - 如何对管理 M2M 关系的视图进行单元测试
- tomcat - 为什么阻塞阀在 Win10 上无法正常工作?
- unity3d - 塑料 CSM 使项目私有/忽略
- laravel - 结合 1)多态多对多和 2)三向枢轴?
- javascript - React-Native 中的 SharedElement 转换
- javascript - 根据其他元素的宽度更改框架的宽度
- python - 从列表中选择 n 个关键字
- r - R 如何使用 lm() 函数计算回归系数
- flutter - Firebase Firestore 未从颤动的文档中返回数据
- python - 处理数据集上的空值