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

Re: need help with syncing two bare repos

From
ESEugene Sajine <euguess@gmail.com>
Date
Aug 3, 2012, 20:31 UTC
Message-ID
<CAPZPVFZpLBXG0Ntbf06dWRS_Z4hVzMXF-2FmfqvT2mN9A8Ektg@mail.gmail.com>
In-Reply-To
<7vboirbva3.fsf@alter.siamese.dyndns.org>
On Fri, Aug 3, 2012 at 4:00 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 17 quoted lines
> Eugene Sajine <euguess@gmail.com> writes:
>
>> I think the best variant would be to do something like:
>>
>> $ git pull --rebase /refs/heads/*:/refs/heads/*
>> $ git push origin /refs/heads/*:/refs/heads/*
>
> You perhaps meant "worst" not "best" here.  From the point of view
> of people who have pushed into the "origin" repository we see above,
> their history is rewritten; you are screwing half the population by
> doing this.
>
> Not allowing B to accept pushes while it is not positively sure that
> A has gone down would of course be the best solution (in your scenario,
> B started serving when it merely found out that *it* cannot contact
> A), but barring that, the recovery for two histories at A and B,
> once they diverged, should be to "merge" corresponding branches.
Junio,

Thanks for chipping in! Please correct me if I'm wrong, but wouldn't merge result in the same history changes for people pushing to the origin (bareA)? Still all their consequent changes will not be fast-forwardable because of merge commit. Or am i missing something? It might be that the command i specified is incorrect.

I meant that I would execute "pull --rebase" (or proper analogue for bare repo) for each branch on B side and then push those refs to A. This way it would pretend that B is another "dev repo". May be you can advise on correct commands to do that properly?

I'll think about not allowing pushes to B while not sure it is really time, so it is not reacting on irrelevant connectivity issues or bareA downtime due to the maintenance.

Thanks, Eugene

Previous: Junio C HamanoNext: Junio C Hamano
Message 4 of 5 in “need help with syncing two bare repos”
  1. Eugene SajineAug 3, 2012
  2. Sitaram ChamartyAug 3, 2012
  3. Junio C HamanoAug 3, 2012
  4. Eugene SajineAug 3, 2012
  5. Junio C HamanoAug 3, 2012

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.