按下时出现Git错误:对象15abe3addde5ad5f7d25e8f0f220d2e9faf3cb22:包含指向null的条目 [英] Git error when pushing: object 15abe3addde5ad5f7d25e8f0f220d2e9faf3cb22:contains entries pointing to null

查看:378
本文介绍了按下时出现Git错误:对象15abe3addde5ad5f7d25e8f0f220d2e9faf3cb22:包含指向null的条目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道我是如何陷入这个混乱的。但是我碰到错误:对象15abe3addde5ad5f7d25e8f0f220d2e9faf3cb22:包含指向null 的条目,当试图将我的存储库推送到GitHub时。全推:

 [ashinn @ puppet1 puppet] $ git push 
计数对象:27,完成。
使用多达2个线程的增量压缩。
压缩对象:100%(11/11),完成。
写作对象:100%(16/16),5.67 KiB,完成。
合计16(delta 6),重用14(delta 4)
错误:对象15abe3addde5ad5f7d25e8f0f220d2e9faf3cb22:包含指向空的条目sha1
致命错误:对象
错误:解包失败:索引包异常退出
到git@github.com:andyshinn / puppet.git
! [远程拒绝]神经节 - >神经节(解包错误)
! [远程拒绝] master - > master(解包错误)
错误:未能将一些文件推送到'git@github.com:andyshinn / puppet.git'
一切都是最新的

Git ls-tree显示我的sudo模块是一个空sha1:

 
[ashinn @ puppet1 puppet] $ git的LS-树15abe3addde5ad5f7d25e8f0f220d2e9faf3cb22
...
160000犯2cc9d02b3cf27d6a06d85612c03710aa0d90149c SSH
160000犯6961179007dce76d7fb9bd1fc361273acb4129a7 STDLIB
160000犯0000000000000000000000000000000000000000须藤
040000树2bd16a8fab440081a876f64d720b5b4d9d119bc9的sysctl
040000树01439b5a20363dccdf3f7103aab701fa7f4b3cd9模板
...



列出的 ssh stdlib sudo 是外部git repos的子模块。文件夹 sysctl 模板是存储库中的文件夹。



我尝试删除模块并重新添加它,现在似乎无法推送任何提交。我做了一些搜索,发现错误很少。我该如何解决这个错误?

解决方案

我终于可以解决这个问题了。以下是我解决它的方法: $ b

https://help.github.com/articles/remove-sensitive-data 有一个标题清除您的回购中的文件。我遵循它们的示例来删除Rakefile,但使用了有问题的文件夹:

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



<由于有问题的树是一个文件夹,我在该命令中添加了 -r 。结果是清理了sudo modiles的所有提交,因此,object 15abe3addde5ad5f7d25e8f0f220d2e9faf3cb22 消失了!变更提交后,推送成功。之后我可以重新添加已损坏的模块而不会出现问题。


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 git@github.com:andyshinn/puppet.git
 ! [remote rejected] ganglia -> ganglia (unpacker error)
 ! [remote rejected] master -> master (unpacker error)
error: failed to push some refs to 'git@github.com: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?

解决方案

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.

这篇关于按下时出现Git错误:对象15abe3addde5ad5f7d25e8f0f220d2e9faf3cb22:包含指向null的条目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆