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

Re: Recovering from missing objects?

From
Jeff King <peff@peff.net>
Date
Feb 20, 2009, 02:58 UTC
Message-ID
<20090220025810.GB22419@coredump.intra.peff.net>
In-Reply-To
<7vvdr6j6hz.fsf@gitster.siamese.dyndns.org>
On Thu, Feb 19, 2009 at 04:29:12PM -0800, Junio C Hamano wrote:
Show 13 quoted lines
> > If I clone the remote repository, I have the object in the new clone.
> > However, how do I get the missing object back into the .git directory of my
> > working repository?
> [...]
> In the new clone:
> 
> 	$ IT=c406ab0be69c912ea59233595a071478103cdad8
> 	$ H=$(git rev-list --objects $IT | git pack-objects mine)
>         $ mv mine-$H.pack /var/tmp
> 
> Go to the repository that lacks the object and then
> 
> 	$ git unpack-objects </var/tmp/mine-$H.pack

Might it not be simpler to just copy or hardlink the pack from the new clone into the old directory's .git/objects/pack? That will get more than you need, but things should start working, at which point a "git repack -a -d" will make it small again.

Or am I misunderstanding something?
-Peff
Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 6 in “Recovering from missing objects?”
  1. Geert UytterhoevenFeb 19, 2009
  2. Junio C HamanoFeb 20, 2009
  3. Jeff KingFeb 20, 2009
  4. Junio C HamanoFeb 20, 2009
  5. Jeff KingFeb 20, 2009
  6. Geert UytterhoevenFeb 20, 2009

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.