git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: How to fetch missing pack

From
Shawn O. Pearce <spearce@spearce.org>
Date
Apr 24, 2008, 06:08 UTC
Message-ID
<20080424060857.GX29771@spearce.org>
In-Reply-To
<200804240801.13674.chriscool@tuxfamily.org>
Christian Couder <chriscool@tuxfamily.org> wrote:
Show 12 quoted lines
> Le mercredi 23 avril 2008, Jörg Sommer a écrit :
> > Peter Baumann <waste.manager@gmx.de> 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.
Previous: Christian CouderNext: Jörg Sommer
Message 5 of 10 in “How to fetch missing pack”
  1. Jörg SommerApr 12, 2008
  2. Peter BaumannApr 13, 2008
  3. Jörg SommerApr 23, 2008
  4. Christian CouderApr 24, 2008
  5. Shawn O. PearceApr 24, 2008
  6. git doesn't finds the parent of a commit (was: How to fetch missing pack)Jörg Sommer, Apr 27, 2008
  7. Stephen R. van den BergApr 27, 2008
  8. Junio C HamanoApr 27, 2008
  9. Stephen R. van den BergApr 27, 2008
  10. Jörg SommerApr 28, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.