1. 程式人生 > >inflate: data stream error (unknown compression method) unable to unpack

inflate: data stream error (unknown compression method) unable to unpack

inflate: data stream error 資料流異常


個人總結,親測成功,不喜勿噴

原因:電腦藍屏關機導致git檔案損壞

解決:
方案一:重新git clone
方案二:
1.控制檯輸入:git fsck --full 檢查損壞的檔案,然後去本地專案下的.git隱藏檔案下搜尋該檔案並刪除,該操作重複進行直到沒有error提示。
2.刪除.git隱藏資料夾下index檔案
3.處理好1,2步驟後控制檯輸入:git reset 重新編譯下
4.此時down檔案可能會報錯:
Local changes were not restored
Before update your uncommitted changes were saved to stash.
Update is not complete, you have unresolved merges in your working tree
Resolve conflicts, complete update and restore changes manually.
區域性變化沒有恢復
在更新之前,未提交的更改被儲存到記憶體中。
更新不完整,工作樹集中有未解決的合併
解決衝突,手動完成更新和恢復更改。
5.點選提示的stash文字,出現以下內容(內容稍許會有不同)
在這裡插入圖片描述


6.clear掉所有的內容,再次down程式碼,會報另外一個錯(由於bug無法重現,並沒有存留圖片),此時點選錯誤提示資訊,會彈出很多衝突檔案,此時刪除你看到的所有檔案
7.重複5,6操作最終會成功

以下是過程中erro示例

//輸入git fsck --full提示的error示例1,你要刪除的是fatal對應的檔案fe6f16c7e8246d61150f0bc42629dbb532b5ce
error: inflate: data stream error (unknown compression method)
error: unable to unpack 38fe6f16c7e8246d61150f0bc42629dbb532b5ce header
error:
inflate: data stream error (unknown compression method) fatal: loose object 38fe6f16c7e8246d61150f0bc42629dbb532b5ce (stored in .git/objects/38/fe6f16c7e8246d61150f0bc42629dbb532b5ce) is corrupt ...
//輸入git fsck --full提示的error示例2,刪除error對應的提示檔案,如果該目錄下不存在這個檔案就忽略
Checking object directories: 100% (256/256), done.
Checking objects: 100% (168543/168543), done. error: refs/remotes/origin/staging: invalid sha1 pointer 0000000000000000000000000000000000000000 error: refs/remotes/origin/development: invalid sha1 pointer 0000000000000000000000000000000000000000 error: refs/remotes/origin/master: invalid sha1 pointer 0000000000000000000000000000000000000000 error: bad ref for refs/remotes/origin/staging broken link from commit 8b0fd4094630fea108b60faa15535ffbc85d87cb to commit bac9f287963b1abb9e4b376b44b4a6500018e9fe Checking connectivity: 169821, done. dangling blob 750718546640b5b14c19cbdb9958d7bcc4b1114c dangling blob e313786318d4c76004728f15a25c6fa68c88b67e ...