今天对代码进行了修改优化,然后往往远程push,但push后报错了

1.git 操作

git add .
git commit -m"fix"
git push origin master:dev-gaochao

2. 报错信息

To https://amc-msra.visualstudio.com/trading-algo/_git/real-trading! [rejected]        master -> dev-gaochao (fetch first)
error: failed to push some refs to 'https://amc-msra.visualstudio.com/trading-algo/_git/real-trading'
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.

3. 原因

之所以出现这个原因,是因为我在线上生成、编辑了README.md文件,而本地代码文件中不包含它,所以线上线下就对不上了。

4. 解决

将线上、线下代码进行合并

git pull --rebase origin dev

然后再进行push

git push origin master:dev

成功:

Enumerating objects: 11, done.
Counting objects: 100% (11/11), done.
Delta compression using up to 4 threads
Compressing objects: 100% (7/7), done.
Writing objects: 100% (7/7), 1.90 KiB | 487.00 KiB/s, done.
Total 7 (delta 4), reused 0 (delta 0)
remote: Analyzing objects... (7/7) (13 ms)
remote: Checking for credentials and other secrets... (1/1) done (1008 ms)
remote: Storing packfile... done (157 ms)
remote: Storing index... done (87 ms)
To https://amc-msra.visualstudio.com/trading-algo/_git/real-trading1919525..6f3asa4dd6  master -> dev

git 解决push报错相关推荐

  1. git 解决push报错:[rejected] master -> master (fetch first) error: failed to push some refs to

    git 解决push报错:[rejected] master -> master (fetch first) error: failed to push some refs to </h1 ...

  2. git 解决push报错:[rejected] master -> master (fetch first)

    文章目录 1.报错详情 2.问题原因 3.解决方案 今天对代码进行了修改优化,然后往往远程push,但push后报错了 1.报错详情 To https://amc-msra.visualstudio. ...

  3. git进行push报错: RPC failed; HTTP 403 curl 22 The requested URL returned error: 403 Forbidden

    一种原因可能是文件太大 此时设置:git config http.postBuffer=524288000 还有一种就是你没有这个仓库的可写权限 此时进入仓库设置:添加协作者,赋予可写权限

  4. 码云git push报错 DeployKey does not support push code 解决办法

    码云git push报错 DeployKey does not support push code 解决办法 首先生成公钥去码云添加公钥有具体教程 添加公钥 一顿操作之后测试一下 git push 嗯 ...

  5. 解决git在push时报错fatal: unable to access ‘https://github.com/sup0C/a.git/‘: errno 10054

    解决git在push时报错fatal: unable to access 'https://github.com/sup0C/a-repository-for--git/': OpenSSL SSL_ ...

  6. git push报错:fatal: unable to access ‘https://XXXX.git/‘: Peer‘s Certificate issuer is not recognized.

    推镜像的时候,git push报错:fatal: unable to access 'https://XXXX.git/': Peer's Certificate issuer is not reco ...

  7. git push 报错 Empty reply from server 或 Failed to connect to github.com port 443: Time out

    git push 报错 Empty reply from server 或 Failed to connect to github.com port 443: Time out 问题出现 报错信息 问 ...

  8. git push 报错 ---error: commit 8aa8e31: email address yin.jiaqing@.....com is not registered in your

    git push 报错: error: commit 8aa8e31: email address yin.jiaqing@haustart.com is not registered in your ...

  9. git push 报错Push rejected、 remote unpack failed 、unpacker error、 failed to push some refs to

    git push 报错Push rejected. remote unpack failed .unpacker error. failed to push some refs to 1.error: ...

最新文章

  1. linux下查看内存使用情况
  2. 使用python3 实现将网页或者文件导出至pdf 文件
  3. DeepLearning索引
  4. Windows RDP协议 Fuzzing 漏洞挖掘研究
  5. 判断网页pdf还是html,html5 – 如何知道PDF.JS是否完成渲染?
  6. 2017 SEERC Divide and Conquer 树上差分
  7. 成为Java流大师–第1部分:创建流
  8. 【转】微服务架构下分布式事务方案
  9. 自定义菜单url不能带_微服务架构【SpringBoot+SpringCloud+VUE】五 || 实战项目微信公众号自定义开发...
  10. 毕设项目,系统搭建笔记文档
  11. 数据结构上机实践第十周项目2 - 用二叉树求解代数表达式
  12. win10字体显示Mac效果+Chrome字体效果增强
  13. 最后一个道士 第二章
  14. 手机知识:手机OTG知识介绍,看完你就懂了
  15. 第五章 政策问题与议程设定
  16. centos安装Docker与使用构建业务镜像挂载卷harbor仓库的高可用及网络模式和资源限制介绍...
  17. USACO--3.2Feed Ratios
  18. Gateway服务网关使用教程
  19. FileNotFoundError: [Errno 2] No such file or directory: ‘ETHZ/eth01/images/image_00000001_2021-10-29
  20. CPU扫盲-CPU如何执行指令以及流水线技术

热门文章

  1. 《智慧识人术》读书笔记
  2. Linux系列——Linux操作指令之ip指令详细理解及常用命令
  3. Kubernetes中pod分类、核心组件、网络模型及kubectl命令使用
  4. STM32F103+VL53L0测距(一)
  5. Ps使用旋转扭曲制作图片
  6. 论文笔记 EMNLP 2021|Modeling Document-Level Context for Event Detection via Important Context Selection
  7. c语言 编程 打怪,一起用C语言打怪物
  8. 10.第三章 数字特征与特征函数(3)
  9. c语言输入学号查找成绩,C语言程序设计按学号查询成绩
  10. Bluesky勒索软件深度技术分析