Reputation: 1304
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?
Upvotes: 59
Views: 50226
Reputation: 1
move the *.pack file into .git folder , then go to .git directory and run the following command:
cat YOUR_PACK_FILE.pack | git unpack-objects
Upvotes: 0
Reputation: 7995
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.
Upvotes: 79