6
我有一個損壞的git對象。 git objects dir中的文件大小爲0。如何從損壞的git文件中恢復
首先一個的fsck:
git fsck --full
fatal: loose object a35c1489005cca1ffeb3c2d3e4d63988408b6a24 (stored in .git/objects/a3/5c1489005cca1ffeb3c2d3e4d63988408b6a24) is corrupted
然後,LS:
ls -l .git/objects/a3/5c1489005cca1ffeb3c2d3e4d63988408b6a24
----------+ 1 sampath ???????? 0 Sep 13 15:26 .git/objects/a3/5c1489005cca1ffeb3c2d3e4d63988408b6a24
該文件不磁盤上存在!?
# git cat-file -t a35c1489005cca1ffeb3c2d3e4d63988408b6a24
error: unable to find a35c1489005cca1ffeb3c2d3e4d63988408b6a24
fatal: git cat-file a35c1489005cca1ffeb3c2d3e4d63988408b6a24: bad file
當我試圖做拉時我首先看到這個錯誤。
我試圖刪除文件,並做了拉,但沒有奏效。它抱怨文件丟失。
當我刪除了該文件,並運行fsck的,這表明了我很多晃來晃去的對象
# git fsck --full
broken link from commit 1e5980c224ff19b19ad99dbefed4c7c64c58aee6
to tree a35c1489005cca1ffeb3c2d3e4d63988408b6a24
dangling tree 0401d636a512b208dffd6ac6e153ab0a061f8d5d
dangling blob 58014c0266784a1e3cc1502de82837c5f36c8514
dangling tree 0507fa56260c693cea678eab0343240c5bba06ad
dangling tree 130770880c664a0b0cf5a21d037cbdba7480dc90
我累了回去幾個提交,並沒有幫助。
有關如何從此恢復的任何指針?
你有一份回購的地方嗎?如果你這樣做,從那裏抓住物體。既然你從某個地方拉它,希望你有這個對象在回購 – Andy
將http://stackoverflow.com/questions/801577/how-to-recover-git-objects-damaged-by-hard-disk-failure幫助? (如果你有回購的備份,當然) – VonC
我試過了。我克隆了存儲庫並解開了對象。但是我找不到尺寸爲0的鬆散對象文件。這是否意味着它屬於我的一個本地提交,尚未被推送到遠程呢? –