git repository failed to traverse parent error

前端 未结 2 2214
走了就别回头了
走了就别回头了 2021-02-20 17:40

I am a newcomer to git and was quite happy until this evening. I have been committing changes regularly. I maintain two remotes on unfuddle and beanstalk and a local filesystem

2条回答
  •  孤城傲影
    2021-02-20 17:59

    I googled this error and found your page, in my case the problem was that I had done:

    git clone --depth 1 https://github.com/example/nifty.git
    

    but months later, forgetting that I had only grabbed the latest commits, when I tried to push it to another remote it complained. It took me a little while to figure out that it wasn't a damaged repo but just the fact that I never had the parent commits! Hopefully that helps someone.

    This fixed it for my case:

    git fetch --unshallow
    

提交回复
热议问题