英文:
convert git dump into local repo
问题
我有一个最初从GitHub导出的git dump。我不知道他们是如何进行导出的,但我已经提取了zip文件,文件的结构如下。
从那个文件夹运行git status
返回:
在分支main上没有要提交的内容,工作树干净
尝试并没有帮助:
git clone exported_dir/ dst_dir/
我希望在那个仓库中看到一些C#代码文件
如何将它们转换为实际的资源,保留所有分支、历史记录、日志等?
英文:
I got a git dump which was originally exported from GitHub.
I can't know how they made the export but I have extracted the zip file and the structure of the files are as below.
git status
from that folder returns with:
On branch main nothing to commit, working tree clean
Tried and didn't help:
git clone exported_dir/ dst_dir/
I do expect to see in that repo some C# code files
How can I convert them to the actual resources keeping all branches, history, logs, etc?
答案1
得分: 0
看起来你收到了一个混合了裸仓库和非裸仓库的内容。通常,如果你有像HEAD
、config
、packed-refs
这样的文件,它已经是一个仓库(没有工作树)。
你可以尝试从这个目录本地使用git clone
命令来"解裸"这个仓库:
git clone unzipped-dir/ somewhere-else/
英文:
It seems you received a mixture of a bare and non-bare repository. Normally if you have files like HEAD
, config
, packed-refs
it's already a repository (without a working tree).
You can try git clone
locally from this directory to "un-bare" the repo:
git clone unzipped-dir/ somewhere-else/
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论