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

Re: Git: How to keep multiple bare repos in sync?

From
Cchenxitwo <chenxitwo@126.com>
Date
Jun 3, 2015, 01:55 UTC
Message-ID
<201506030955200885513@126.com>
In-Reply-To
<2015051315014048836362@126.com>
Hi Konrad Scherer,
	Thanks for your reply.
 
	But git mirror is helpless for me.
	I have an idea about two repos' sync. However there is a problem with this is how to prevent other usrs' push operation.
 
	Details as follows:
	Team A, B have their own git server repos, respectively repos_A, repos_B.
	step1: The repos_A locking repos_B When repos_A received Team_A requests to push, and repos_B can't accept other users' push request. (use pre-receive hook)
	step2: After the repos_A is updated, the repos_A will send push request to the repos_B.
	step3: After the repos_B is updated, the repos_A will unlock the repos_B.
 
	Problem: How to lock git remote repos to prevent other usrs' push operation.
 

-------------- chenxitwo

Show 31 quoted lines
>not remote sync.  
>
>We have three teams to participate in the same project, and is located in different places. Bandwidth that between the two of our teams is not enough. Three teams have their own git server. Like this kind of situation, how should handle?
>
>
>
>chenxitwo
>
>From: Junio C Hamano
>Date: 2015-05-13 12:37
>To: chenxitwo
>CC: git
>Subject: Re: Git: How to keep multiple bare repos in sync?
>chenxitwo <chenxitwo@126.com> writes:
>
>> There are three git server(bare repos), but i don't know to solve the
>> problem that how to keep these git servers in sync.
>
>rsync?
>
>The problem is under-specified.  Is there one of them that is
>authoritative and that the other ones should match its progress?
>If so, perhaps push from the authoritative one to the other two
>with "push --mirror" (or have the other ones "fetch --mirror")?
>
>If you are allowing people to push into any of them randomly,
>then there is no general solution.  If I push an update to 'master'
>of instance A while you update the same 'master' branch of instance
>B, somebody has to reconcile the divergence between the two by
>creating a merge, and that can possibly conflict, needing human
>intervention to resolve.
Previous: chenxitwoNext: David Lang
Message 4 of 6 in “Git: How to keep multiple bare repos in sync?”
  1. chenxitwoMay 13, 2015
  2. Junio C HamanoMay 13, 2015
  3. chenxitwoMay 13, 2015
  4. chenxitwoJun 3, 2015
  5. David LangJun 3, 2015
  6. Konrad SchererMay 14, 2015

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.