threads / discuss / 9200

copying objects from another repo?

Subject: copying objects from another repo?

## tl;dr

2 messages between Jul 24, 2007 and Jul 24, 2007.

replies: 1people: 2as markdown or json

Michael S. Tsirkin· Jul 24, 2007, 10:35 UTC · lore

I had some missing objects that I managed to locate in another tree. So - how to get them to my repo? Here's what I came up with:

cd ~/scm/good_tree git tag -f foo dfaa7049e9ebe227cfcffc49d3de16716764bcbd cd ~/scm/bad_tree git fetch-pack ~/scm/good_tree dfaa7049e9ebe227cfcffc49d3de16716764bcbd

And I repeated this for all missing objects. But is there a better way to do this?

-- 
MST
Johannes Schindelin· Jul 24, 2007, 11:14 UTC · re: Michael S. Tsirkin · lore

Re: copying objects from another repo?

Hi,
On Tue, 24 Jul 2007, Michael S. Tsirkin wrote:
Show 11 quoted lines
> I had some missing objects that I managed to locate
> in another tree. So - how to get them to my repo?
> Here's what I came up with:
> 
> cd ~/scm/good_tree
> git tag -f foo dfaa7049e9ebe227cfcffc49d3de16716764bcbd
> cd ~/scm/bad_tree
> git fetch-pack ~/scm/good_tree dfaa7049e9ebe227cfcffc49d3de16716764bcbd
> 
> And I repeated this for all missing objects.
> But is there a better way to do this?
This is what I have done in such a case:
In the valid repo:
	$ git gc
	$ scp .git/objects/packs/* the-broken:repo.git/objects/packs/
In the broken repo:
	$ git gc
Done.

Hth, Dscho

← back to recent threads