2

I'm attempting to deploy my local repo to a remote directory. I've run git init --bare in this remote directory, and added the correct ssh path to my local git repo branch (named dev) with git remote add server ssh://user@domain.com:2222/path/to/repo.

When I run git push server dev I get the following output:

Counting objects: 44, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (37/37), done.
Writing objects: 100% (44/44), 89.58 KiB, done.
Total 44 (delta 2), reused 27 (delta 2)
error: Could not read 551dd5c5d67e3b2da4074d8f15a59a324a063a03
fatal: Failed to traverse parents of commit 0615b940c3247e3547de1379ab09a4a6bb614252
error: Could not read 551dd5c5d67e3b2da4074d8f15a59a324a063a03
fatal: Failed to traverse parents of commit 0615b940c3247e3547de1379ab09a4a6bb614252
To ssh://user@domain.com:2222/path/to/repo
 ! [remote rejected] dev -> master (missing necessary objects)
error: failed to push some refs to 'ssh://user@domain.com:2222/path/to/repo'

I'm not sure what is going on here.

Ryan Fisher
  • 1,485
  • 1
  • 19
  • 32
  • 1
    What does `git fsck` say about your local repository? – cdhowie Nov 09 '12 at 03:38
  • Thanks, I'm still learning the basics of git. I had dangling commits and I believe that was causing the problem. This is a fresh repo for me so I simply deleted it and created a new repo and dev branch from scratch. – Ryan Fisher Nov 09 '12 at 03:55
  • 1
    Dangling commits wouldn't be a problem, they are only commits that are not referenced -- junk that will be cleaned up later. What would be concerning is if one of your commits referenced a parent commit that doesn't exist. – cdhowie Nov 09 '12 at 03:56
  • I'm not sure how that would occur. However I was playing around with this repo learning the basics of git so it's definitely possible that I deleted a parent commit or something of that nature. – Ryan Fisher Nov 09 '12 at 04:03

1 Answers1

3

As mentioned in "git repository failed to traverse parent error", this can also be caused by a shallow clone.

In your case though (testing repo), restarting from scratch is the easiest.

In general, you have interesting advices in this thread:

1. Use "git rev-list --objects" to find out what 40aaeb204dc was.

And if that doesn't work:

2. Run "git fsck --full", with packs intact. This will take a while.
The result would include a list of missing objects (like 40aaeb204dc), and, most importantly, their type.

Following howto/recover-corrupted-blob-object.txt would be useful for identifying a corrupt loose object.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250