如何解压 git 存储库的所有对象?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/16972031/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to unpack all objects of a git repository?
提问by Chico Sokol
How can I unpack allobjects of a pack file?
如何解压缩包文件的所有对象?
I've just cloned a remote repository, so my local repository currently doesn't contain any loose object, only a .pack and a .idx files.
我刚刚克隆了一个远程存储库,所以我的本地存储库当前不包含任何松散对象,只有一个 .pack 和一个 .idx 文件。
I've tried running git unpack-objects < .git/objects/pack/pack-.pack
, but nothing happens.
我试过跑步git unpack-objects < .git/objects/pack/pack-.pack
,但没有任何反应。
I'm doing something wrong? Is there any other command to do that?
我做错了什么?有没有其他命令可以做到这一点?
回答by William Seiti Mizuta
You need to move the pack objects outside the .git/objects/pack
directory before using the command. However, the pack files need to be inside the repository.
.git/objects/pack
在使用该命令之前,您需要将包对象移动到目录之外。但是,包文件需要在存储库中。
For example, create a directory name SAMPLE
in your project's root. Then, move the pack files to SAMPLE
directory. After that, inside the repository without the pack files, use the command git unpack-objects < SAMPLE/*.pack
. Git will generate all objects inside .git/objects
directory of your repository.
例如,SAMPLE
在项目的根目录中创建一个目录名称。然后,将包文件移动到SAMPLE
目录。之后,在没有包文件的存储库中,使用命令git unpack-objects < SAMPLE/*.pack
. Git 将在.git/objects
您的存储库目录中生成所有对象。