【问题标题】:How can I "git push" when I face Error : error: failed to push some refs to "my remote git address"当我遇到错误时如何“git push”:错误:无法将一些参考推送到“我的远程 git 地址”
【发布时间】:2021-07-07 08:01:07
【问题描述】:

我有一个问题,推送命令不起作用。

首先,为了在 git-hub 中创建远程存储库,我做了一些可以推送我的 .c 文件的事情。一开始效果很好。

但我更改了一些代码,并输入了终端 git add & git commit 来推送我的 c 文件。

最后我进入了 git push,我遇到了这个错误。

! [rejected] main -> main(先获取) 错误:未能将一些引用推送到“存储库地址”

我在谷歌看到了很多解决方案,所以我已经做了“git pull”。但它不起作用。

我的错误

我附上捕获,其中包含 git status 和 git push error。

【问题讨论】:

  • 读取 git 状态。您尚未完成正在中间的合并。

标签: git github git-push


【解决方案1】:

在推送之前运行 git commit。

【讨论】:

  • 我做了,但它显示“文件存在”。 .感谢您的评论。
猜你喜欢
  • 2014-07-29
  • 2020-03-04
  • 2022-01-25
  • 2012-08-26
  • 2012-04-07
  • 2013-03-07
  • 1970-01-01
  • 2021-08-07
  • 2013-03-28
相关资源
最近更新 更多