git repository failed to traverse parent error

前端 未结 2 2210
走了就别回头了
走了就别回头了 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
    
    0 讨论(0)
  • 2021-02-20 18:13

    "Dangling" objects may not be a problem. It could just mean that you've done some resetting, rebasing, and/or deleted branches that weren't fully merged. "Missing", on the other hand, is more serious, I believe. Take a look at this article on repairing a damaged repo. That might help you out. You could also try upgrading git if you're out of date. A newer version might be a little smarter.

    0 讨论(0)
提交回复
热议问题