git - 解决only-a-file push的拒绝推送
问题描述
如何解决 only-a-file push 的被拒绝推送以替换其在 github 上的远程对应项?
试试这个https://happygitwithr.com/push-rejected.html
没有任何成功
例如消息
! [rejected] main -> main (fetch first)
error: failed to push some refs to 'https://github.com/abdulbadii/MatrixMultiplier'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details
解决方案
似乎其他人在同一个 git 分支上工作,所以只需使用
git stash
然后运行 git pull origin branch_name
,然后获取您的更改,运行 git stash pop
之后推送你的代码
推荐阅读
- java - Eclipse 重构项目以使用不同类的简单方法
- android - 程序类型已经存在:com.nineoldandroids.animation.Animator
- javascript - 运动 RNA 转录失败
- mysql - 某些值的 MySQL 自定义输出
- python - 使用 ijson 迭代解析 JSON 文件
- coq - Coq:排序列表的子列表也排序?
- linux - 将 AWS 服务的 127.0.0.1 更改为 0.0.0.0
- r - R Shiny - 反应数据帧下载到 csv
- amazon-web-services - 部署后的 AWS Code Pipeline 运行命令
- git - 有没有办法“扩展”svn命令行来预处理源文件