Git尝试在推送时获取Null提交

Jcs*_*Jcs 5 git

我使用该--bare选项将github存储库克隆到另一个裸存储库中.但是,当我将提交推送到此存储库时,我得到此输出:

Fetching remote heads...
  refs/
  refs/tags/
  refs/heads/
  refs/remotes/
  refs/remotes/origin/
  fetch 0000000000000000000000000000000000000000 for refs/remotes/origin/HEAD
Unable to fetch 0000000000000000000000000000000000000000, will not be able to update server info refs
updating 'refs/heads/master'
  from db82a9e0b834b59922b42ff193984f7cbc4fb295
  to   b694385d28056e9182314f770b1380a424f49bfa
    sending 4 objects
    done
Unable to update server info
To http://www/git/asi-http-request.git
   db82a9e..b694385  master -> master
Run Code Online (Sandbox Code Playgroud)

我正在使用DAV传输,因此仅包含的更新后挂钩git update-server-info不会被执行,使最后一次提交不可见.我必须手动运行update-server-info命令

我注意到该refs/remotes/origin/HEAD文件包含一个refs/remotes/origin/master不存在的符号引用.我试图在原始存储库中创建包含master分支的提交引用,但是在推送新提交时我仍然面临同样的错误.

git版本是1.7.2.5

有没有人知道发生了什么以及如何解决它?

编辑2013年2月1日

git log HEAD遥控器上的储存库命令返回输出(I去除作者提交信息):

commit b694385d28056e9182314f770b1380a424f49bfa
Author: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Date:   Tue Jan 29 18:44:05 2013 +0100

    ...

commit db82a9e0b834b59922b42ff193984f7cbc4fb295
Author: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Date:   Tue Jan 29 10:59:59 2013 +0100

    ...

commit 6300b759329d5d5d715d0fc76d15424c12a87bd4
Author: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Date:   Sat Jan 5 13:28:27 2013 +0100

    ...
Run Code Online (Sandbox Code Playgroud)

自从我跑步以来,我不确定这是否相关git update-server-info.

Nil*_*ner 0

我会尝试不将存储库克隆到一个存储库中--bare

  • cd your_bare
  • git clone --bare git@github.com...

首先将其克隆为普通的

创建你的裸仓库

  • cd your_bare
  • git init --bare

现在克隆存储库

  • cd /tmp
  • git clone git@github.com...
  • cd repo
  • git remote rename origin upstream

并将其推送到您的裸仓库

  • git remote add origin your_bare
  • git push origin master