问题描述
我不知道我是如何陷入这个混乱的。但是我碰到错误:对象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
致命错误:对象
错误:解包失败:索引包异常退出
到[email protected]:andyshinn / puppet.git
! [远程拒绝]神经节 - >神经节(解包错误)
! [远程拒绝] master - > master(解包错误)
错误:未能将一些文件推送到'[email protected]: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
在有一个标题清除您的回购中的文件。我遵循它们的示例来删除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 [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-dateGit 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
, andsudo
are submodules of external git repos. Folderssysctl
andtemplate
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的条目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!