7

I deployed code using capistrano into a remote machine, but I get the following error. How do i get rid of this issue.

    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
Rpj
  • 3,526
  • 12
  • 36
  • 80
  • 1
    Could you add some information about your repository setup, plus the command you ran to get this output? – Matt Kantor May 03 '13 at 16:51
  • Its a github repository and the git clone and the subsequent checkout is causing this issue. – Rpj May 03 '13 at 16:55
  • Could you try taking Capistrano out of the equation and just run the commands yourself (one at a time)? Please edit your question and include the commands you enter + their output. – Matt Kantor May 03 '13 at 16:57
  • @MattKantor I did that earlier and execute each step separately and got the exact same error – Rpj May 03 '13 at 17:00
  • I've added some more commands to the ticket. – Rpj May 03 '13 at 17:03
  • Is it possible there were a recetn pull request? https://github.com/travis-ci/travis-ci/issues/617#issuecomment-6691627 – VonC May 04 '13 at 21:16
  • I think your answer could be here http://stackoverflow.com/questions/2155887/git-submodule-head-reference-is-not-a-tree-error – sites May 05 '13 at 03:32
  • See there is a short answer too `git submodule sync` `git submodule update` – sites May 05 '13 at 03:33
  • Try `composer clear`: https://github.com/symfony/symfony/issues/6641#issuecomment-424635069 – Ryan Aug 18 '19 at 17:21

1 Answers1

5

I had to deal with a broken repository too. After commenting out Capistrano's shallow clone option (:git_shallow_clone, 1 which yields --depth 1) deployment worked well.

See the accepted answer of this question for a detailed explanation on how to possibly fix it: Git submodule head 'reference is not a tree' error

Community
  • 1
  • 1
ToniTornado
  • 2,051
  • 27
  • 34