How to unpack all objects of a git repository?

泪湿孤枕 提交于 2019-11-26 09:36:36

问题


How can I unpack all objects 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.

I\'ve tried running git unpack-objects < .git/objects/pack/pack-.pack, but nothing happens.

I\'m doing something wrong? Is there any other command to do that?


回答1:


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.

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.



来源:https://stackoverflow.com/questions/16972031/how-to-unpack-all-objects-of-a-git-repository

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!