git報錯:! [rejected] master -> master (fetch first)

$ git push https://github.com/ysksolution/git-demo.git/ master

报错:

To https://github.com/ysksolution/git-demo.git/
! [rejected] master -> master (fetch first)
error: failed to push some refs to ‘https://github.com/ysksolution/git-demo.git/’
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.

解決方案,需要先远程库pull,然后在push

git pull https://github.com/ysksolution/git-demo.git/ master
git push https://github.com/ysksolution/git-demo.git/ master

相关推荐

  1. git:! [rejected] master -> master (fetch first)

    2024-05-10 22:28:03       11 阅读
  2. <span style='color:red;'>Git</span>

    Git

    2024-05-10 22:28:03      34 阅读
  3. Git

    2024-05-10 22:28:03       12 阅读
  4. 【<span style='color:red;'>Git</span>】

    Git

    2024-05-10 22:28:03      12 阅读

最近更新

  1. 关于go和rust语言的对比

    2024-05-10 22:28:03       0 阅读
  2. python入门基础知识·二

    2024-05-10 22:28:03       0 阅读
  3. 概率基础——矩阵正态分布matrix normal distribution

    2024-05-10 22:28:03       0 阅读
  4. 网络编程:常用网络测试工具

    2024-05-10 22:28:03       1 阅读
  5. 在 React 中使用自定义 Hooks 封装 Service 逻辑

    2024-05-10 22:28:03       1 阅读
  6. 【AI原理解析】—遗传算法(GA)原理

    2024-05-10 22:28:03       1 阅读
  7. 微服务: 初识 Spring Cloud

    2024-05-10 22:28:03       1 阅读

热门阅读

  1. qt窗口置顶

    2024-05-10 22:28:03       11 阅读
  2. Python 的主要应用领域有哪些?

    2024-05-10 22:28:03       13 阅读
  3. 矩阵的压缩存储

    2024-05-10 22:28:03       11 阅读
  4. js实现定时器

    2024-05-10 22:28:03       12 阅读
  5. UE5缺少SDK,而无法在windows平台打包的解决方法

    2024-05-10 22:28:03       12 阅读
  6. 行列视能解决哪些问题

    2024-05-10 22:28:03       13 阅读