Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git error when pushing: object 15abe3addde5ad5f7d25e8f0f220d2e9faf3cb22:contains entries pointing to null

I'm not sure how I have got myself into this mess. But I am running into error: object 15abe3addde5ad5f7d25e8f0f220d2e9faf3cb22:contains entries pointing to null when trying to push my repository to GitHub. The full push:

[ashinn@puppet1 puppet]$ git push
Counting objects: 27, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (11/11), done.
Writing objects: 100% (16/16), 5.67 KiB, done.
Total 16 (delta 6), reused 14 (delta 4)
error: object 15abe3addde5ad5f7d25e8f0f220d2e9faf3cb22:contains entries pointing to null sha1
fatal: Error in object
error: unpack failed: index-pack abnormal exit
To [email protected]:andyshinn/puppet.git
 ! [remote rejected] ganglia -> ganglia (unpacker error)
 ! [remote rejected] master -> master (unpacker error)
error: failed to push some refs to '[email protected]:andyshinn/puppet.git'
Everything up-to-date

Git ls-tree shows that my sudo module is a null sha1:

[ashinn@puppet1 puppet]$ git ls-tree 15abe3addde5ad5f7d25e8f0f220d2e9faf3cb22
...
160000 commit 2cc9d02b3cf27d6a06d85612c03710aa0d90149c  ssh
160000 commit 6961179007dce76d7fb9bd1fc361273acb4129a7  stdlib
160000 commit 0000000000000000000000000000000000000000  sudo
040000 tree 2bd16a8fab440081a876f64d720b5b4d9d119bc9    sysctl
040000 tree 01439b5a20363dccdf3f7103aab701fa7f4b3cd9    template
...

The listed ssh, stdlib, and sudo are submodules of external git repos. Folders sysctl and template are folders in the repo.

I have tried removing the module and re-adding it and can't seem to push any commit now. I've done some searching and found little on the error. How can I resolve this error?

like image 334
Andy Shinn Avatar asked Sep 30 '12 05:09

Andy Shinn


1 Answers

I was able to finally solve this issue. Here is what I did to solve it:

In article https://help.github.com/articles/remove-sensitive-data there is a heading for Purge the file from your repo. I following their example for removing the Rakefile but used the problematic folder instead:

git filter-branch --index-filter 'git rm -r --cached --ignore-unmatch modules/sudo' --prune-empty --tag-name-filter cat -- --all

Since the problematic tree was a folder I added -r to the command. The result was a cleanup of all the commits for the sudo modiles and thus, object 15abe3addde5ad5f7d25e8f0f220d2e9faf3cb22 disappeared! After a commit of the changes, the push was successful. I was able to later re-add the broken module without issue.

like image 199
Andy Shinn Avatar answered Nov 15 '22 20:11

Andy Shinn