git Git未能推送一些参考?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5994566/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Git failed to push some refs?
提问by Jay Levitt
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:
我们在 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'
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?
我能找到的关于这个错误的所有讨论要么是关于先拉后推,要么是关于包对象死亡;该错误在实际中意味着什么,我们应该怎么做?
采纳答案by manojlds
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.
当服务器终止长时间运行的进程或存在一些网络问题时,它可能会间歇性地发生。在服务器上也可能有一个权限,其中 repo 上的某些文件由不同的用途拥有。
回答by Voloda2
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
回答by rlandster
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.
我有一个类似的问题。出于某种原因[branch "master"]
,我的.git/config
文件中缺少一个。添加该行解决了问题。
回答by utopman
This issue went from the server side repository initialization for me. I did :
这个问题来自我的服务器端存储库初始化。我做了:
git init
instead of :
代替 :
git --bare init
Push works now. :)
推现在工作。:)