Re: How to fetch missing pack

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Christian Couder <chriscool@xxxxxxxxxxxxx> wrote:
> Le mercredi 23 avril 2008, Jörg Sommer a écrit :
> > Peter Baumann <waste.manager@xxxxxx> wrote:
> > >
> > > Try using git fsck --full to check you repo. If you are missing some
> > > objects, you could just grab them from another valid repo which still
> > > has them.
> >
> > How can I exctract single objects from a pack?
> 
> Please have a look at this:
> 
> http://git.or.cz/gitwiki/GitFaq#head-ac11406480d09e2df98588e800e41b7256602074

If you know the name of the objects you are missing, you can
make a temporary pack to transfer the list of objects:

	# at good repo
	#
	git pack-objects --stdout <object.list >save.pack

	# at bad repo
	#
	git index-pack --stdin <save.pack

Make object.list just one SHA-1 per line.  The resulting pack is
not likely to be highly compressed, as it will probably contain
a non-delta version of each object, but its faster to create than
calling git-cat-file for each object, and may give you a smaller
pack than just copying everything as the FAQ entry recommends.

Note that you may need to do this several times; e.g. if you are
missing a tree you won't know what blobs you are missing until
you load the tree and run fsck --full again to parse the tree and
discover the missing blobs.  This iterative copying approach is
what the FAQ avoids when it suggests you copy everything.

-- 
Shawn.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux