推送时的git错误(远程未能报告状态)



我从github企业遥控器中克隆了一个使用选项" - mirror"的存储库。

我想在另一个远程存储库中推出该存储库,但是我有以下错误:

>     ! [remote failure]        XXXX-7342f50b84fbfff3a2bbdcf81481dbcb2d88e5cd -> XXXX-7342f50b84fbfff3a2bbdcf81481dbcb2d88e5cd (remote failed to report status)
>     error: failed to push some refs to 'git@github.ZZZZ.com:XXXX/YYYY.git'
>     Branch master set up to track remote branch master from origin.

运行git gc为我解决了这一点。这将执行一些垃圾收集的管家任务,可能导致此问题。

我有一个确切的错误,我被要求将我导入到我们的github企业服务器中。

git gc帮助了它仅将存储库的大小降低到仅7GB,但我仍然无法推动它,因为有〜13k标签(显然每个人都至关重要!),这些标签以与以相同的方式列为错误OP报告。

解决方案是在较小的块中推动标签,例如

git push refs/tags/tag-2015* git@my_server:my_org/my_repo

您可以将其放入循环中,然后将所有标签推入块中,例如

for n in {15..20}; do git push refs/tags/tag-20${n}* git@my_server:my_org/my_repo; done

现在,当您执行原始push --mirror

在做到这一点之前,我也以类似的方式推动了分支机构,但是由于这并不能解决问题,所以我认为这并不重要。但是,这是相关的,这是您在裸露的存储库中切换到每个分支的方式。

git branch -a --format "%(refname)" | xargs -i bash -c "git symbolic-ref HEAD {} && git push git@my_server:my_org/my_repo"

这可能是一个神话,但是我出于此错误的原因是Git在其中有一些隐藏的限制。在这种情况下,按下标签必须在5分钟内完成整个操作完成。因此分解过程有效。

看来我必须参考很多参考(〜9000)。删除其中的大多数问题

我做了git pull --rebase branchname,然后 git push origin branchname

我在推动用SVN2GIT生成的存储库时遇到了这个问题。显然,没有开放的PR(全新的空上游回购),repackgc无济于事。存储库的大小似乎不是一个因素。以下是一些观察:

  1. 推到 github Enterprise (自我托管):push --mirror工作正常。
  2. 推向 github.com 时,我会得到这个问题。但是:
  • git push --tagsgit push --all工作良好。
  • git push --mirrorrefs/backups/*refs/replace/*
  • 上失败

我的结论是,对于GitHub.com不喜欢的某些参考可能会出现此问题,但是--all --tags足以满足我的需求。

当github降低时,似乎也会发生此错误(您可以在此处检查github的状态),因为目前我正在编写此错误。我遇到了类似的错误,在Internal Server Error之前:

davidcalhoun@Davids-MacBook-Pro hugo % git push
Enumerating objects: 11, done.
Counting objects: 100% (11/11), done.
Delta compression using up to 16 threads
Compressing objects: 100% (5/5), done.
Writing objects: 100% (6/6), 485 bytes | 485.00 KiB/s, done.
Total 6 (delta 4), reused 2 (delta 0)
remote: Resolving deltas: 100% (4/4), completed with 4 local objects.
remote: Internal Server Error
To github.com:davidcalhoun/davidbcalhoun.com.git
 ! [remote failure]    master -> master (remote failed to report status)
error: failed to push some refs to 'git@github.com:davidcalhoun/davidbcalhoun.com.git'

最新更新