Git 无法推送一些参考?

发布于 2024-11-06 17:05:00 字数 1998 浏览 0 评论 0原文

我们在 sourcerepo.com 上托管了一个裸露的 git 存储库。有时,在推送时,我们会收到“错误:无法推送某些引用”,但推送成功,如果缺少任何内容,则不清楚是什么。这并不是常见的问题,即先拉后推。请参阅:

2t2% git pull
remote: Counting objects: 57, done.
remote: Compressing objects: 100% (30/30), done.
remote: Total 30 (delta 25), reused 0 (delta 0)
Unpacking objects: 100% (30/30), done.
From tiptap.sourcerepo.com:tiptap/2t2
   cb6c0e5..1dfea54  master     -> origin/master
Merge made by recursive.
 app/stylesheets/facebox.scss          |   11 +++
 app/stylesheets/screen.scss           |   28 ++++++--
 app/views/answers/tip_detail.html.erb |    2 +
 app/views/shared/_tip_box.html.erb    |   26 ++++---
 app/views/tip/tip_answer.js.erb       |   37 ++++++++++-
 config/application.rb                 |    2 +-
 public/javascripts/application.js     |    1 -
 public/javascripts/tip_animation.js   |  116 +++++++++++++++++++++++++++++++++
 public/stylesheets/facebox.css        |   11 +++
 9 files changed, 212 insertions(+), 22 deletions(-)
 mode change 100644 => 100755 app/views/shared/_tip_box.html.erb
 mode change 100644 => 100755 app/views/tip/tip_answer.js.erb
 mode change 100644 => 100755 config/application.rb
 mode change 100644 => 100755 public/javascripts/application.js
 create mode 100755 public/javascripts/tip_animation.js
2t2% git push
Counting objects: 18, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (10/10), done.
Writing objects: 100% (10/10), 1.54 KiB, done.
Total 10 (delta 7), reused 0 (delta 0)
To [email protected]:tiptap/2t2.git
   1dfea54..faf6014  master -> master
error: failed to push some refs to '[email protected]:tiptap/2t2.git'

我能找到的有关此错误的所有讨论要么是关于“先拉后推”,要么是关于“包对象死亡”;该错误在野外意味着什么,我们应该采取什么措施?

We have a bare git repository hosted on sourcerepo.com. Sometimes, when pushing, we get "error: failed to push some refs", but the push succeeds, and if anything's missing, it's not apparent what. This is NOT the common problem where you have to pull before you can push; see:

2t2% git pull
remote: Counting objects: 57, done.
remote: Compressing objects: 100% (30/30), done.
remote: Total 30 (delta 25), reused 0 (delta 0)
Unpacking objects: 100% (30/30), done.
From tiptap.sourcerepo.com:tiptap/2t2
   cb6c0e5..1dfea54  master     -> origin/master
Merge made by recursive.
 app/stylesheets/facebox.scss          |   11 +++
 app/stylesheets/screen.scss           |   28 ++++++--
 app/views/answers/tip_detail.html.erb |    2 +
 app/views/shared/_tip_box.html.erb    |   26 ++++---
 app/views/tip/tip_answer.js.erb       |   37 ++++++++++-
 config/application.rb                 |    2 +-
 public/javascripts/application.js     |    1 -
 public/javascripts/tip_animation.js   |  116 +++++++++++++++++++++++++++++++++
 public/stylesheets/facebox.css        |   11 +++
 9 files changed, 212 insertions(+), 22 deletions(-)
 mode change 100644 => 100755 app/views/shared/_tip_box.html.erb
 mode change 100644 => 100755 app/views/tip/tip_answer.js.erb
 mode change 100644 => 100755 config/application.rb
 mode change 100644 => 100755 public/javascripts/application.js
 create mode 100755 public/javascripts/tip_animation.js
2t2% git push
Counting objects: 18, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (10/10), done.
Writing objects: 100% (10/10), 1.54 KiB, done.
Total 10 (delta 7), reused 0 (delta 0)
To [email protected]:tiptap/2t2.git
   1dfea54..faf6014  master -> master
error: failed to push some refs to '[email protected]:tiptap/2t2.git'

All of the discussion I can find about this error is either about the pull-before-you-push or about pack-objects dying; what does the error mean in the wild, and what should we do about it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

合久必婚 2024-11-13 17:05:00

如果您忘记创建第一次提交并开始推送,则可能会发生此错误。所以你需要创建第一个提交。

git add .
git add -u
git commit -m "First commit"
git push

This error may occur if you forgot to create first commit and started push. So you need to create first commit.

git add .
git add -u
git commit -m "First commit"
git push
执手闯天涯 2024-11-13 17:05:00

当服务器终止长时间运行的进程或存在某些网络问题时,它可能会间歇性地发生。此外,服务器上可能有一个权限,其中存储库上的某些文件由不同的用途拥有。

It can happen intermittently when the server kills a long running process or there is some network issue. Also there might be a permission on server where some files on the repo are owned by a different use.

云仙小弟 2024-11-13 17:05:00

我有类似的问题。由于某种原因,我的 .git/config 文件中缺少 [branch "master"] 。添加该行解决了问题。

I had a similar problem. For some reason I was missing a [branch "master"] in my .git/config file. Adding that line fixed the problem.

雨落□心尘 2024-11-13 17:05:00

这个问题来自于我的服务器端存储库初始化。
我做了 :

git init

而不是 :

git --bare init

Push 现在可以工作了。 :)

This issue went from the server side repository initialization for me.
I did :

git init

instead of :

git --bare init

Push works now. :)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文