【问题标题】:git checkout throws fatal reference is not a treegit checkout 抛出致命引用不是一棵树
【发布时间】:2013-05-03 16:47:04
【问题描述】:

我使用 capistrano 将代码部署到远程机器中,但出现以下错误。我该如何摆脱这个问题。

    executing locally: "git ls-remote git@github.com:mycompany/foo.git staging"
    command finished in 468ms
  * getting (via checkout) revision df3d0367fd021d83f881f5d7261dba3f891bca22 to /tmp/20130503165924
    executing locally: git clone -q --depth 1 git@github.com:mycompany/foo.git /tmp/20130503165924 && cd /tmp/20130503165924 && git checkout -q -b deploy df3d0367fd021d83f881f5d7261dba3f891bca22
fatal: reference is not a tree: df3d0367fd021d83f881f5d7261dba3f891bca22

【问题讨论】:

  • 您能否添加一些有关您的存储库设置的信息,以及您运行以获得此输出的命令?
  • 它是一个 github 存储库,而 git clone 和随后的结帐导致了这个问题。
  • 您能否尝试将 Capistrano 排除在外,然后自己运行命令(一次一个)?请编辑您的问题并包括您输入的命令及其输出。
  • @MattKantor 我之前做过,分别执行每个步骤并得到完全相同的错误
  • 我在工单中添加了更多命令。

标签: git capistrano


【解决方案1】:

我也必须处理损坏的存储库。在注释掉 Capistrano 的浅层克隆选项(:git_shallow_clone, 1 产生 --depth 1)后,部署运行良好。

有关如何解决此问题的详细说明,请参阅此问题的已接受答案:Git submodule head 'reference is not a tree' error

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-10-05
    • 2018-10-18
    • 2012-11-05
    • 2018-07-02
    • 2015-11-06
    • 1970-01-01
    • 2015-12-20
    • 1970-01-01
    相关资源
    最近更新 更多