簡體   English   中英

如何克隆損壞的 git repo

[英]How to clone a corrupted git repo

我在嘗試克隆 repo 時遇到的錯誤:

$ git clone git@repo.xx.xx.com:project.git
Cloning into 'project'...
remote: fatal: empty filename in tree entry
error: git upload-pack: git-pack-objects died with error.
fatal: git upload-pack: aborting due to possible repository corruption on the remote side.
remote: aborting due to possible repository corruption on the remote side.
fatal: early EOF
fatal: index-pack failed

有沒有辦法解決這個問題?

如果沒有對服務器的管理訪問權限或干凈的副本,您幾乎無能為力。 但是,由於您認為損壞會影響最近的一些提交,您可以嘗試克隆另一個分支並查看是否有效。

首先,讓我們看看可以克隆的內容:

git ls-remote git@repo.xx.xx.com:project.git

這應該為您提供服務器上可用的參考列表。 找到候選人后,請嘗試將其克隆

git clone --single-branch --branch refname git@repo.xx.xx.com:project.git

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM